-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Update to 5.0 SDK #17945
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
Update to 5.0 SDK #17945
Conversation
That version doesn't show up in |
Directory.Build.targets
Outdated
| TargetFramework="netcoreapp5.0" /> | ||
|
|
||
| <!-- Reference base shared framework at incoming dependency flow version, not bundled sdk version. --> | ||
| <FrameworkReference Update="Microsoft.NETCore.App" |
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.
Hmm I wonder how this ever worked. @wtgodbe the version you're linking to is the runtime version for Microsoft.NETCore.App. The error message is complaining that it cannot find the appropriate version of Microsoft.AspNetCore.App. I wonder if we need to apply this workaround to M.AspNetCore.App as well. Also, I'm curious how this ever worked without this workaround.
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.
@JunTaoLuo why wouldn't this work given the $(NETCoreAppMaximumVersion) setting? EF doesn't reference Microsoft.AspNetCore.App anywhere.
Suggest instead updating @(KnownFrameworkReference) items instead of @(FrameworkReference) but that's reasonably minor.
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 think when we had a 3.0 SDK, the KnownFrameworkReference for Microsoft.AspNetCore.App was a 3.0 version, which we were able to restore from nuget (3.0.0-rc1-19456-20). Now with the 5.0 SDK, that default reference is versioned 5.0.0-alpha1.19466.7 per the binlog, which we can't restore since it's not in nuget or the dotnet-core feed. What feed to we publish AspNetCore stuff to? We could just add that to nuget.config.
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.
Hmm, I think it's implicit since dotnet-ef targets 5.0 after my change (my bad) https://github.com/aspnet/EntityFrameworkCore/blob/master/src/dotnet-ef/dotnet-ef.csproj#L15. I think the recommendation is for dotnet CLI tools to target a lower fixed TFM and allow roll forward: dotnet/diagnostics#227.
So theoretically, we should make a change in 3.1 to make this tool target netcoreapp3.0 and then add the roll forward option in the json file. That should also fix the error @wtgodbe saw.
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.
Again, exactly what in this repo references Microsoft.AspNetCore.App? That sounds like a bug.
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 think it's the KnownFrameworkReference from the 5.0 SDK, which does try to pull in the package which the build complains it can't find (5.0.0-alpha1.19466.7). The old 3.0 SDK referenced a version that's present on nuget.org.
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 think we're getting our wires crossed, we can discuss this in person at the next standup.
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.
dotnet-ef project might have issues but that's a red herring for this problem. Instead, let's remove all Microsoft.AspNetCore.App items from the @(KnownFrameworkReference) group.
dougbu
left a comment
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.
Probably need similar changes in other SDK update PRs.
| <KnownAppHostPack Include="@(KnownAppHostPack->WithMetadataValue('TargetFramework', 'netcoreapp3.0'))" | ||
| TargetFramework="netcoreapp5.0" /> | ||
| <KnownFrameworkReference Include="@(KnownFrameworkReference->WithMetadataValue('TargetFramework', 'netcoreapp3.0'))" | ||
| TargetFramework="netcoreapp5.0" /> |
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.
Don't remove this logic; it'll help to have around the next time we deal w/ a new TFM before an SDK is ready. Instead, make this conditional on lack of '%(TargetFramework) == $(DefaultNetCoreTargetFramework)` items in each group.
Directory.Build.targets
Outdated
| TargetFramework="netcoreapp5.0" /> | ||
|
|
||
| <!-- Reference base shared framework at incoming dependency flow version, not bundled sdk version. --> | ||
| <FrameworkReference Update="Microsoft.NETCore.App" |
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.
@JunTaoLuo why wouldn't this work given the $(NETCoreAppMaximumVersion) setting? EF doesn't reference Microsoft.AspNetCore.App anywhere.
Suggest instead updating @(KnownFrameworkReference) items instead of @(FrameworkReference) but that's reasonably minor.
|
Failing with the package icon issue, I'll fix first in a separate PR:
|
|
Suggestion: Do the package icon change in parallel with getting this in. For this PR, just disable the NuGet warning / error. |
|
Checking to see if the package icon fix works with these changes |
- For additional context: dotnet/efcore#17945 (comment).
|
This looks good locally now, assuming we don't need info about the packageIcon in the .nuspec. Waiting to hear back from @tmat on that one. |
|
As per dotnet/ef6#1286 (comment), looks like we don't need to worry about the |
|
(Will also contribute to https://github.com/aspnet/AspNetCore-Internal/issues/3103) |
|
With the last change, this now includes the |
dougbu
left a comment
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.
Please split this in two because the package icon portion needs to be done in 'release/3.0' and that's somewhat urgent. Include the necessary <NoWarn/> w/ the 5.0 SDK bit until that change flows into 'master'.
Separately, the package icon changes should also remove <NoWarn>NU5048;$(NoWarn)</NoWarn> elements where they exist. That might need to be done separately since I doubt we have that in 'release/3.0' branches.
Directory.Build.props
Outdated
| <None Include="$(PackageIconFullPath)" Pack="true" PackagePath="\"/> | ||
| </ItemGroup> | ||
| </Project> | ||
| </Project> |
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: Avoid changing the final newlines. This results in files thrashing back and forth.
Part of https://github.com/aspnet/AspNetCore-Internal/issues/3016
CC @ajcvickers @dougbu @JunTaoLuo