Running VS version 15.9.4, I followed the instructions (I think), but I'm still having trouble upgrading an existing 2.1 project to the latest stable (2.2.3)
Here is my dotnet --info
And here is my project file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Configurations>Debug;Release;DEBUG_LOCALAPI</Configurations>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>
<Content Remove="appsettings.Development.json" />
<Content Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
<None Include="appsettings.Development.json" />
<None Include="appsettings.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.0.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PublishingAPICommon\PublishingAPICommon.csproj" />
</ItemGroup>
</Project>
If I try to install 2.2.3 to that project from NuGet manager, this is the error message I get:
Severity Code Description Project File Line Suppression State
Error NETSDK1045 The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. PublishingStorage C:Program Filesdotnetsdk2.1.502SdksMicrosoft.NET.SdktargetsMicrosoft.NET.TargetFrameworkInference.targets 137
And here is what I see in VS when I try to edit the project properties:
Things I have tried:
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi @TracyGH ... update your VS to latest ... I think it's like 15.9.11 or something. It's likely going to need updates in order to recognize and allow you to use that more recent SDK.
Also ...
Microsoft.AspNetCore.Mvc.Versioning
is at 3.1.2 ... https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.Versioning/3.1.2
Yep ... 15.9.11 ... lucky guess ... probably a good Pick-5 number for the lottery tonight! :smile: 💰 (except for all of those 1's)
https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes
I'm going to go ahead and close. If you have more trouble with it, hit up the devs on a support chat, such as Stack Overflow, or a support chat, such as Slack or Gitter. Here's the Slack self-signup and Gitter address:
@guardrex - Thank you for the tips! I will give those a try and let you know if none of them fix the issue.
I did post my question on StackOverflow, and it looks like someone else is having a similar problem that they posted about the day before.
Also, the existing documentation for upgrading indicates that users need Visual Studio 15.9+.
The versioning refers to the minor version ... 15.7 vs 15.8 vs 15.9 .... then 16 for the jump to VS2019 RTM. We assume that the dev will have the latest patch release for any of those. These patch releases do tie into the .NET Core SDK availability, so I wouldn't be surprised if when you get it updated to 15.9.11 that you get that 2.2 SDK working. If not, we'll have to direct you over to the product unit to ask. Yes, let me know how it turns out.
Oh ... and btw ... the respondent on that SO ... @dasMulli (Martin Ullrich ... who in that picture looks like a Star Trek ensign flirting with disaster in a _red shirt_! lol) ... a good friend of mine. You can trust his remarks like you were getting them from the :pray: _server gods!_ :pray: lol ... He's rescued hundreds ... maybe thousands ... of devs. Isn't that right, @SabotageAndi?! :wink:
But whatever the case with that particular SO, I wouldn't trust anything without the latest patch release. You're doing the right thing by getting it up to latest.
PS Martin ... please put on a blue ensign shirt. Although plenty of blue shirts died, too, I think your odds are a lot better on away missions in a blue shirt.
Thanks @guardrex, for following up!
I did update my VS instance to 15.9.11, but I'm still having the same trouble. I went ahead and created a brand new test project (.NET Core Class Library template), and it is also generating the error. You can see the project file in the screenshot below, and dotnet --info
is still returning the same results...
Any thoughts?
@TracyGH Go to https://dotnet.microsoft.com/download/dotnet-core/2.2 and download the installer for the 2.2.105 version.
Anything >= 2.2.200 will not work in VS 2017.
Both 2.2.105 and 2.2.202 contain the latest and greatest .NET Core 2.2 version but they differ in the version of the tools they include and are based on - the 1xx train is MSBuild 15., NuGet 4. etc. and the 2xx train is MSBuild 16., NuGet 5. and so on and Visual Studio only looks for the latest version compatible with its version of MSBuild - for VS 2017 this is 2.1.502 version which cannot target .NET Core 2.2. (And to add more confusion, there are now 2.1.6xx versions with VS 2019 tool versions together with the .NET Core 2.1 runtime)
[@]leecow and [@]rowanmiller are working on updating that page regarding VS, also see https://github.com/dotnet/core/issues/2542 and https://github.com/dotnet/sdk/issues/3076 which are about the same problem.
I was _close_. lol
That worked perfectly, thank-you @dasMulli!
For others info: After installing 2.2.105, I deleted the folder(s) titled '2.2.202' in directory C:\Program Files (x86)\dotnet\sdk
and/or C:\Program Files\dotnet\sdk
so that dotnet --info
now reads the following:
Very good. Thanks from me, too, @dasMulli ... that's another case of :beer: for u on top of the _TEN_ cases I already owe you! :smile:
We can close now, right @TracyGH? This won't be actionable for this doc set because it deals with tooling and .NET Core SDK versioning.
[EDIT] oh ... already closed. We're good. :+1:
[off-topic] @guardrex btw I actually do have a similar shirt in blue 😄 https://www.youtube.com/watch?v=B2nvNMW3LVQ
Most helpful comment
@TracyGH Go to https://dotnet.microsoft.com/download/dotnet-core/2.2 and download the installer for the 2.2.105 version.
Anything >= 2.2.200 will not work in VS 2017.
Both 2.2.105 and 2.2.202 contain the latest and greatest .NET Core 2.2 version but they differ in the version of the tools they include and are based on - the 1xx train is MSBuild 15., NuGet 4. etc. and the 2xx train is MSBuild 16., NuGet 5. and so on and Visual Studio only looks for the latest version compatible with its version of MSBuild - for VS 2017 this is 2.1.502 version which cannot target .NET Core 2.2. (And to add more confusion, there are now 2.1.6xx versions with VS 2019 tool versions together with the .NET Core 2.1 runtime)
[@]leecow and [@]rowanmiller are working on updating that page regarding VS, also see https://github.com/dotnet/core/issues/2542 and https://github.com/dotnet/sdk/issues/3076 which are about the same problem.