Blog

.NET程序发布生成为单文件

–self-contained 为附带运行时(Runtime)

dotnet publish -c Release --self-contained -r win-x86 -p:PublishSingleFile=true -p:DebugType=none -p:PublishTrimmed=true -p:EnableCompressionInSingleFile=true -o ./publish/x32

–no-self-contained 为不附带运行时(Runtime)

dotnet publish -c Release --no-self-contained -r win-x86 -p:PublishSingleFile=true -p:DebugType=none -o ./publish/x32