-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Installing SDK 2.2.1 but no way to update SDK Dependencies from 2.2.0 to 2.2.1 #7014
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
Comments
I have to manually edit the csproj file to change this:
to
|
@wstaelens this is no longer a recommended approach to set the version to the |
@masterjs I cannot find a "global.json" in my solution or folder? |
@wstaelens you should read up on it a little bit, its very useful. (https://docs.microsoft.com/en-us/dotnet/core/tools/global-json) thank you, |
ok I can follow, but when not using a global.json. How can I ensure the latest version of Microsoft.AspNetCore.App is used from the latest installed SDK? Like in my case I had SDK 2.2.0, downloaded and installed SDK 2.2.1 but the Microsoft.AspNetCore.App stayed at 2.2.0. Only thing I could do is add a specific version. Without adding a global.json, is this a bug or is there another solution to not specifying the version number and still using the latest version? |
Open a dev command line and run |
@wstaelens I also just found this documentation on the MS site that exactly explain how its is "implicitly" getting the right version: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/metapackage-app?view=aspnetcore-2.2 this should answer all your questions! |
@masterjs thanks for the info. ... so after installing the latest SDK, I would expected that version 2.2.1 of the Microsoft.AspNetCore.App package would be used (by looking at the SDK Dependencies in the Solution Explorer) if I read that last link. This was not the case. Version 2.2.0 was still being used after installing 2.2.1 and restarting Visual Studio. That is why I've unloaded my project and added a version number manually. Strange… or at least very confusing! |
@natemcmaster - any further thoughts on this? |
...only that this further justifies why we're refactoring this experience in 3.0. cref #3612 The previous commenters are correct - you do not need to add the version attribute to the PackageReference. Just installing the latest .NET Core SDK or Runtime installers is enough to get 2.2.1. See https://natemcmaster.com/blog/2018/08/29/netcore-primitives-2/ if you want to read more details on this subject. Closing as a duplicate of dotnet/project-system#3791. |
@masterjs @natemcmaster @Eilon ok i've removed the version from the csproj file. added a json file called "global.json" with this info:
and my SDK dependencies still show Microsoft.AspNetCore.App (2.2.0) instead of 2.2.1.
(i tried version numbes 2.2.100, 2.2.1, etc...) |
@natemcmaster you closed it, but tell me. I'm still stuck at 2.2.0 now for the Microsoft.AspNetCore.App package. When i edit the project file and add a version number to it, it is ok, but not recommended, so I removed it again. I've added a json file called global.json as suggested and added the specific sdk version, but the Microsoft.AspNetCore.App is still at 2.2.0 instead of 2.2.1. |
You don't need to reference the higher package. I referenced dotnet/project-system#3791 because the UI is misleading. If you have installed the 2.2.1 runtime, your application will automatically rollforward to use it. By default, .NET Core always runs on the highest patch installed on the machine, 2.2.* in your case because you target 'netcoreapp2.2'. I know this is confusing and breaks the traditional usage of a PackageReference, which is why in .NET Core 3.0, we will no longer be using NuGet to distribute the Microsoft.AspNetCore.App reference. See #3307 and #3612 if you want more details on this subject. |
The primary purpose of these 'SDK' package references is to provide the C# compiler with "reference assemblies" (sort of like headers in C#). Unlike most normal packages, Microsoft.AspNetCore.App and Microsoft.NETCore.App do not put more *.dll files in your build output. If you run Because of this, the package version is always going to stay at '2.2.0', regardless of which SDK you are using. We don't add new .NET Core APIs in patch releases, and by targeting the 2.2.0 reference, your application will remain compatible with any machine that has .NET Core 2.2 installed. he reason upgrade is blocked from the UI is that it often has unintended consequences. Most users do not need to change this version. If you would like to read more details on how this works, here are some docs and a blog post I wrote explaining these concepts. |
I have SDK 2.2.0, and installed SDK 2.2.103
Now I expected to see or find a way to update the SDK dependencies from version 2.2.0 to 2.2.1, but can't find a way to make this happen.
bug?
The text was updated successfully, but these errors were encountered: