ElectronNet 将应用程序发布到带有引用程序集的单文件错误

分享于2022年07月17日 .net blazor blazor-server-side electron 问答
【问题标题】:ElectronNet 将应用程序发布到带有引用程序集的单文件错误(ElectronNet publish app to single-file error with referenced assembly)
【发布时间】:2022-06-13 02:32:56
【问题描述】:

我正在尝试 electronize 我的 blazor 应用程序。该应用程序引用了另一个编译为 dll 的项目。

所以根据 this thread ,这是原因 1,我应该预料到这个错误 - 当我尝试通过指定 MyApp 发布应用程序时可以修复它并且它工作正常:

dotnet electronize build MyMainApp /target win /PublishReadyToRun true 

现在的问题是当我想通过 electronize start 运行应用程序时,会自动生成以下命令

dotnet publish -r win-x64 -c "Debug" --output "C:\MyApp\obj\Host\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --no-self-contained

而且我找不到删除 /p:PublishSingleFile=true 部分的方法,因此它不适用于引用的项目!


【解决方案1】:

GibHub Issues 中记录了一个修复程序

electronize build /target win /PublishSingleFile false /PublishReadyToRun false