You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In short, I can build a self-contained project and then package it up, with the --no-build option, like so:
$configuration="Release"$runtime="win-x64"$framework="net9.0"# project built in a previous step
dotnet publish MyProject.csproj `--configuration $configuration`--runtime $runtime`--framework $framework`--no-restore `--no-build
That works fine.
If I repeat that, but publish a single file, like so:
To the csproj in the repo, as suggested here: #45159 (comment), and the --no-build exe is the same size as the exe built without the --no-build option.
I've created a repo and a README.md detailing some investigation here: https://github.com/andygjp/MustInstalDotNetSelfContainedNoBuild
In short, I can build a self-contained project and then package it up, with the
--no-build
option, like so:That works fine.
If I repeat that, but publish a single file, like so:
It fails with: "You must install .NET to run this application."
If I repeat the last command, but remove the
--no-build
option, it works again.Why must I have to build it again or remove
--property:PublishSingleFile
option to make it work?The text was updated successfully, but these errors were encountered: