有谁能够帮助我。
我正在尝试将我的 .net 核心控制台应用程序发布到单个文件中。
我正在使用这个命令:
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
我期待它会创建一个文件。但仍然有dll文件:clrcompression.dll
clrjit.dll
coreclr.dll
mscordaccore.dll
我该如何解决?我已经搜索过了,但结果是一样的
最佳答案
要捆绑 native 库,您需要指定 IncludeNativeLibrariesForSelfExtract
旗帜。
所以试着运行这个 dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:IncludeNativeLibrariesForSelfExtract=true
见 https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file#other-considerations
关于c# - 将 .net core 5.0 发布到单个 exe 文件中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65134756/