Closed agocke closed 1 year ago
I propose that we disable this behavior for .NET 5+
@KathleenDollard @marcpopMSFT Do you have any concerns about removing the legacy self-contained publish behavior in .NET 5?
This shouldn't be a breaking change, since users will have to upgrade to net5
explicitly, and the same behavior should be achievable by doing a publish
.
@agocke would the behavior during build remain unchanged if a project explicitly sets SelfContained=true
? Blazor WebAssembly requires rid specific runtime assets are copied to the build output directory for an app to function as part of dotnet run
.
rid specific runtime assets are copied to the build output directory
I think this should still happen. That is, if you have runtime-specific dependencies, build
should copy them to the output directory for the build. I just don't see why it should do a self-contained deployment instead of a framework dependent deployment. My rule would be: do as little as possible to successfully run on the local machine. Since the native dependencies are necessary even to run locally, they would be copied out, but copying over the entire framework is unnecessary because we, by definition, already have it on the machine.
@agocke It's still a change in behavior, just one the customer has to opt into by targetting 5.0. That being said, as discussed offline, I think we agree that build should be for local development and publish for running externally. @KathleenDollard has final say in the matter on. We don't think many people specify a RID on the command line during the build command so this may be low impact.
It seems like this came up again in our email thread about https://github.com/dotnet/sdk/pull/29031
Completed in 8.0.100
dotnet build
appears to produce a self-contained application when passed a runtime identifier via-r
for compatibility with .NET Core 1.0. This looks like it should be publish-specific behavior.To improve UX here I think we need a much clearer delineation between build and publish. Build should be about producing binaries for running and testing on the local machine. Publishing should be about producing binaries for deploying on other machines.