【问题标题】:How to publish my WPF solution with Rider?如何使用 Rider 发布我的 WPF 解决方案?
【发布时间】:2019-09-09 22:33:18
【问题描述】:

我似乎无法使用 Rider IDE 部署我的 WPF 应用程序。大多数支持告诉我使用 VS 中的“发布”按钮,这当然对我没有帮助。

我确实使用 .NET 项目.NET 可执行文件 构建配置生成了一个可执行文件,但它似乎无法在任何其他机器上运行,看起来立即关闭而不吐出错误消息(即使来自 PowerShell)

注意该应用程序可以从我自己的机器上正常启动,也可以从我选择将其移动到的任何地方启动。

我尝试将Edit Configurations... > Runtime arguments: 设置为

dotnet publish -c Release -r win10-x64

正如this post 中所建议的那样,但这还不够。

从 PowerShell 运行 dotnet publish -c Release -r win10-x64 .\my_app.csproj 返回

error MSB4216: Impossible to execute the task "GenerateResource" 
[...] 
Failed to connect to "CLR4" runtime and the "x86" architecture.
Make sure that
(1) The necessary runtime and/or architecture is present on the machine
(2) "C:\Program Files\dotnet\sdk\<version>\MSBuild.exe" exists and 
    has permissions to execute.

现在该文件夹中缺少 MSBuild,但那里有 MSBuild.dll。

我真的错过了一种使用 Rider 发布 C# WPF 解决方案的简单方法吗?

【问题讨论】:

    标签: c# wpf publish rider


    【解决方案1】:

    我使用https://wixtoolset.org/ 发布我的应用程序。它是免费的并且独立于 IDE...

    【讨论】:

    • @mcy - 是的,这并不容易,但值得。它由 msbuild 支持,并且(一旦完成)您还可以在自动构建过程中使用它轻松退出。
    猜你喜欢
    • 1970-01-01
    • 2018-10-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多