-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Breaking change]: RuntimeSpecific Apps in .NET Will No Longer Be SelfContained
by default, and instead Framework Dependent By Default
#33726
Comments
Update: This has been delayed from Preview 1 to Preview 2. I will provide an update when possible; we may redecide this part of the decision:
|
We did reach a final decision. Here are the new details about this break. It will go into preview 5. Here are the new things that arent listed above: Changes to Publish Property BehaviorsSome Publish Properties currenlty only work if IF the targetframework is 8 or higher: The difference here is that its only during publish. And for PublishTrimmed this is new behavior. The exception to this is Why this changeWe made this decision based on which properties do not currently support apps that are Action to takeIf someone is affected by this break they should specify SelfContained as either true or false depending on the behavior they want. They can add it in their project file or in the command line as earlier described. |
@gewarren Please let me know if there are any questions here. Thank you! |
Preview 5 it is! |
Description
RuntimeSpecific Apps (.NET Apps with a
RuntimeIdentifier
) Will No Longer BeSelfContained
by default, and instead Framework Dependent By Default.dotnet/sdk#30038
cc @richlander.
Version
.NET 8 Preview 5
Previous behavior
Previously, if
RuntimeIdentifier
(RID) was specified, the app would beSelfContained
(SC) ifSelfContained
was not explicitly specified.New behavior
Now, for apps with
TargetFramework
8.0 or higher,RuntimeIdentifier
no longer impliesSelfContained
by default. Instead, apps that give a runtime identifier will be dependent on the .NET Framework by default (FDD). Apps for .NET 7 or below will not see this change in behavior.This is a break for any customer that deployed, distributed, published, etc, their app, and desired their app to not require the .NET Framework to be installed on the machine for it to work, but did not explicitly add
SelfContained
to get this behavior. They may have relied on the old behavior to produce a .NET Framework INDEPENDENT app by default.This is a break for anyone relying on the IL Link tool. Users will have to take the steps described below to use IL Link again.
Note: Some
Publish
properties likePublishTrimmed
, andPublishSingleFile
,PublishAot
, currently requireSelfContained
to work and using these properties will requireSelfContained
to be added now.This is a break for Blazor WASM apps as they relied on this behavior. We expect the Blazor WASM team to side-step this breaking change in their SDK by adding
SelfContained
automatically for all customers, so Blazor customers should be unaffected.Type of breaking change
Reason for change
Previously we warned of this breaking change with the following warning in .NET 6:
We have given customers time to add
SelfContained
explicitly.As for why the change is being made:
Recommended action
Customers using .NET 7 and below who relied on the old behavior where
SelfContained
was inferred will see this warning:They should follow the guidance of the warning if they want to continue to produce
SelfContained
apps. If they would like to move to the new default, they can setSelfContained
asfalse
, in the project file, likeor in the call to
dotnet,
likedotnet publish --no-self-contained
.For .NET 8, nothing needs to be specified unless the old default is desired, in which case the customer must add
SelfContained
astrue
.Feature area
SDK
Affected APIs
No response
Associated WorkItem - 67115
The text was updated successfully, but these errors were encountered: