Closed
Description
Setting PublishSingleFile=true
in the project file has implication on how dotnet build
and dotnet run
operates which are unexpected.
It will:
- Build as self-contained - this makes the build slower - it requires the RID specific runtime pack (which is not part of the default SDK install) and it copies all of the runtime into output (lot of files and quite large)
- Build for a specific RID (so not portable which is the default without
PublishSingleFile=true
- the effect of this is that the output is in a different location (the output directory has the RID subdirectory appended to it) - Use single-file host even for the
dotnet build
output, but without appending anything to it. Honestly it's surprising this even works at all. It's definitely not intended as the right behavior.
I assume some of this is related to the "RID defaulting" behavior introduced in 7.0, but it's questionable if it's a good behavior or not.
The single-file host is just a bug - we should NOT be doing that under any circumstances.
Note that this has effect on dotnet run
which will use the wrong host to run the app. It seems to mostly work, but it's unclear if there are corner cases where it will break.
Metadata
Metadata
Assignees
Type
Projects
Status
No status