-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add logic to roll forward to patch versions of .NET Core for self-contained apps but not shared framework apps or libraries #1222
Add logic to roll forward to patch versions of .NET Core for self-contained apps but not shared framework apps or libraries #1222
Conversation
Am I correct in assuming the change will affect the version of the NuGet package being referenced? This would then require a restore using the same properties when called through msbuild directly.. (breaking change?). |
By itself this doesn't change anything, as we only want to apply the new logic to patches that we ship in the future. Previously we were rolling forward to the latest patch version (that existed at the time the SDK ships) for all apps. This changes the behavior so that in the future, we will only roll forward to patch versions for self-contained apps, while shared framework apps will continue to target version x.y.0. There was some discussion about referencing newer NuGet packages but downgrading the version written to the runtimeconfig.json. However, that feels a bit dangerous to me. In general we don't support compiling against a later version of something and running on a previous version of it. It's likely that we won't add any APIs in patch versions or make any other changes that would break this, but I think it's simpler and safer to keep them in sync. Does that help explain things? |
Yes, thanks! So this likely requires |
@dotnet-bot test Windows_NT_FullFramework Debug |
Yeah, if we have another issue where there's an issue we want to fix with the package but not the runtime, then we might need to think about a split between the package version and the version that goes in runtimeconfig.json. I hope it doesn't come to that :-)
|
@dotnet-bot test Windows_NT_FullFramework Debug |
@MattGertz for approval |
@dsplaisted Template? |
<!-- If not covered by the previous cases, use the target framework version for the implicit RuntimeFrameworkVersions --> | ||
<Otherwise> | ||
<PropertyGroup> | ||
<ImplicitRuntimeFrameworkVersionForSharedApp>$(_TargetFrameworkVersionWithoutV)</ImplicitRuntimeFrameworkVersionForSharedApp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use the term FrameworkDependent
in code. This is the term we use in documentation: https://docs.microsoft.com/en-us/dotnet/articles/core/deploying/
And also in the rest of the SDK code: https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/ProjectContext.cs#L19-L23
|
||
private void It_targets_the_right_framework( | ||
string testIdentifier, | ||
string targetFramework, string runtimeFrameworkVersion, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: I think putting some args on new lines, and some inline makes this hard to read.
@@ -30,37 +30,75 @@ public class GivenThatWeWantToBuildANetCoreApp : SdkTest | |||
[InlineData("netcoreapp1.1", null, "1.1.2", "1.1.2")] | |||
[InlineData("netcoreapp1.1", "1.1.0", "1.1.0", "1.1.0")] | |||
[InlineData("netcoreapp1.1.1", null, "1.1.1", "1.1.1")] | |||
public void It_targets_the_right_shared_framework(string targetFramework, string runtimeFrameworkVersion, | |||
private void It_targets_the_right_shared_framework(string targetFramework, string runtimeFrameworkVersion, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change to private
?
…tained apps but not shared framework apps or libraries Fixes dotnet#983
daac244
to
c817abd
Compare
@MattGertz for approval Customer scenario Targeting and running an app. This change means we will default to targeting the latest patch version of .NET Core for self-contained apps (so they get the latest updates), but for framework-dependent apps, we will target the Bugs this fixes: Workarounds, if any Explicitly set Risk Low. Performance impact Low - this is an update to logic which is statically evaluated by MSBuild Is this a regression from a previous update? Yes. We had policy (first introduced in #878) which would cause regressions in SDK updates. Root cause analysis: Hosts that provide a shared framework aren't necessarily immediately updated to a new runtime when we release that runtime together with an SDK. How was the bug found? Hosters and developers deploying to hosts reported the issue when they found that apps were broken when publishing to the hosts. |
c817abd
to
325c345
Compare
Fixes #983