Hello
I publish an application using the command line
dotnet publish Project.csproj -o .\Publish -p:PublishReadyToRun=false -p:PublishSingleFile=true --self-contained false
It means I want to get a small single .exe but not the large self-contained .exe in the output folder.
<SelfContained></SelfContained> is not defined in the .csproj
If I build using the dotnet SDK 8.0 or 9.0, I get the small sibgle exe.
But dotnet SDK 10 ignores the explicit flag --self-contained false and build the big self-contained exe.
To Reproduce
-
create the simple Console .csproj, without Property
-
create global.json
{
"sdk": {
"version": "10.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}
-
run
dotnet publish Project.csproj -o .\Publish -p:PublishReadyToRun=false -p:PublishSingleFile=true --self-contained false
-
change global.json
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}
-
run
dotnet publish Project.csproj -o .\Publish -p:PublishReadyToRun=false -p:PublishSingleFile=true --self-contained false
-
compare the 2 outputs.