.NET Maui CLI发布报错:不支持.DLL文件及架构中性问题
.NET Maui应用Windows MSIX发布失败排查
我有一款已投产一年多的.NET Maui应用,此前多次更新发布均正常。更换新电脑后,在Visual Studio终端的PowerShell执行以下发布命令:
dotnet publish myapp.csproj -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64
之前该命令可正常生成所需MSIX包,但现在执行时报错:
Error: Input file with '.DLL' extension not supported.
我已尝试以下操作,均未解决问题:
- 清理重建项目
- 卸载并重新加载项目
- 检查项目配置
- 重新克隆GitHub仓库
- 重启电脑
- 更新Visual Studio
按照@Serg的建议添加-bl参数执行构建后,出现新错误:
error: Packaged .NET applications with an app host exe cannot be ProcessorArchitecture neutral. Please specify a RuntimeIdentifier or a Platform other than AnyCPU.
随后我修改.csproj文件,在顶层及相关条件节点中添加以下配置:
<Platforms>x64</Platforms> <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
但上述两个错误依然存在。
内容的提问来源于stack exchange,提问作者Cam06002
相关产品推荐
相关产品推荐

