admin管理员组文章数量:1314496
We have a WPF application that we are trying to publish as a single file.
I am running the command:
dotnet publish .\{path_to_projectA_csproj_file}.csproj -c Release --self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --nologo -v q --property WarningLevel=0 /clp:ErrorsOnly
It generates the following files:
Problem is, when trying to run it in test environment, it does not find a third party .dll. Error from event log:
The third party .dll is referenced in ProjectB that is referenced by ProjectA that I am trying to publish.
Third party .dll reference in ProjectB .csproj:
I tried:
- using the "-p:IncludeAllContentForSelfExtract=true" publish parameter - did not help
- setting build action to Content - did not help
- settings .csproj parameters CopyToOutputDirectory and CopyToPublishDirectory to PreserveNewest - did not help
tl;dr how to include third party libraries into .exe file when publishing a dotnet application as single file?
We have a WPF application that we are trying to publish as a single file.
I am running the command:
dotnet publish .\{path_to_projectA_csproj_file}.csproj -c Release --self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --nologo -v q --property WarningLevel=0 /clp:ErrorsOnly
It generates the following files:
Problem is, when trying to run it in test environment, it does not find a third party .dll. Error from event log:
The third party .dll is referenced in ProjectB that is referenced by ProjectA that I am trying to publish.
Third party .dll reference in ProjectB .csproj:
I tried:
- using the "-p:IncludeAllContentForSelfExtract=true" publish parameter - did not help
- setting build action to Content - did not help
- settings .csproj parameters CopyToOutputDirectory and CopyToPublishDirectory to PreserveNewest - did not help
tl;dr how to include third party libraries into .exe file when publishing a dotnet application as single file?
Share Improve this question asked Jan 30 at 11:52 daily_driverdaily_driver 1151 silver badge9 bronze badges 1- Maybe you'll find something worth a read in the docs Single-file deployment. – Prolog Commented Feb 2 at 18:33
1 Answer
Reset to default 0The third-party .dll was compiled as 32-bit, so I had to add a "win-x86" runtime identifier to the project.
本文标签: aspnet coreHow to include third party libraries in dotnet publish as single fileStack Overflow
版权声明:本文标题:asp.net core - How to include third party libraries in dotnet publish as single file? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741968115a2407669.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论