I have an existing solution containing some projects targeting .Net Core 2.1 and .Net Standard 2.0.
I installed VS2019, and the solution builds. If I open VS2017 and try to build the same solution, I get errors saying:
The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.1.
and
The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0.
This was working before install of VS2019, and still works in VS2019, just not in VS2017.
@dsplaisted are there any known issues with the SDK resolver that might explain what @jgunzy is experiencing? It looks like 2017 is no longer using a 2.1 SDK after a 2019 install, for some reason.
I got the same error after upgrading from 15.9.10 to VS 2017 15.9.11. It worked before the upgrading...

And when debugging, the browser came up with an error HTTP Error 502.5 - Process Failure.

Similar things on SO: https://stackoverflow.com/questions/55513335/the-current-net-sdk-does-not-support-targeting-net-core-2-2-sdk-2-2-202 - in this case not being able to taget 2.2
I remember there was some discussion about the installer changing to remove "old" .NET SDK versions from VS.
Could there be a problem that causes VS (2019) updates to remove 2.2.1xx and replace it with 2.2.202 which then no longer allows VS 2017 to resolve to a 2.2.* version that is compatible with its MSBuild 15 distribution?
@jgunzy, @v-etzha could you provide the output of dotnet --info and tell us which VS versions you have and had previously on your machine?
I was able to repro this by removing all the .Net Core > 2.x on my machine. Then Installing latest releases of VS 2017 and VS2019, enabling 2.2 development tools in VS 2019. Then VS 2017 ASP.NET core projects targeting 2.2 fail to build. Here is the dotnet --info
icrosoft Windows [Version 10.0.17763.379]
(c) 2018 Microsoft Corporation. All rights reserved.
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.2.202
Commit: 8a7ff6789d
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.202\
Host (useful for support):
Version: 2.2.3
Commit: 6b8ad509b6
.NET Core SDKs installed:
1.0.0-preview2-003131 [C:\Program Files\dotnet\sdk]
1.1.12 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.2.202 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
@dasMulli as far as I'm aware, only the recent previews of .NET Core 3.0 will uninstall previous SDKs, and only back to a certain preview release of the 3.0 SDK. The 2.1 and 2.2 installs should never be touched by the 3.0 installer.
@dbreshears Thanks for the repro. I'm going to take a look and see if I can get my VS 2017 into the same state to investigate.
Either @jgunzy or @dbreshears, just to be sure, are you able to build the problematic project from the command line using dotnet build?
as far as I'm aware, only the recent previews of .NET Core 3.0 will uninstall previous SDKs,
@peterhuene my thoughts exactly but I don't know what the VS installer may decide to do.. if it also tries to do some housekeeping this could lead to problems as well - e.g. not deciding to install 2.2.105 if you have 2.2.202 or "I'm upgrading my dependencies - oh there seem to be some left over that I myself installed previously"
It seems that on another machine I seem to have ended up in a similar situation. I remember hand installing 2.2.105, but all previous versions (e.g. 104) are gone now, but I can't tell when it happened since I used VS 2019 previews exclusively..
I haven't yet been able to reproduce. I uninstalled every .NET Core SDK on the system. I reinstalled the .NET Core SDKs via the 2017 (15.9.11) installer; this installed a 2.0 SDK (2.1.202) and a 2.1 SDK (2.1.505).
I was then able to build 2.1 targeted projects. I manually installed SDK 2.2.105 and was then able to build netcoreapp2.2 projects in 2017.
I reinstalled the .NET Core SDKs via the 2019 (16.0.0) installer. This installed 2.2.202 and 2.1.602. Both the previous 2.1 SDK installed by 2017 and the 2.2 SDK I manually installed remained.
I reopened the project in 2017 and was able to build with both a netcoreapp2.2 and a netcoreapp2.1 TFM.
@peterhuene if you only have the lastest SDK (2.2.202) you will not be able to compile the project through VS 2017. This has happened with me and i needed to install 2.2.105 along so i can build through VS 2017...
https://github.com/dotnet/cli/issues/11072
but i think i have the issue at the wrong place
@peterhuene, yes building from the command line succeeds using dotnet build. It seems the only difference is that I did not manually install 2.2.105
@diedona that's the correct place for your issue too; ideally we'd have the issues in only dotnet/cli, but it's the same team that owns both repos and we track both issue lists together.
So it appears we're not doing a good job of communicating the fact that 2.1.602 and 2.2.202 require MSBuild 16 and that is only available in 2019. Thus those SDKs aren't getting resolved by 2017 because it uses MSBuild 15.
We recommend anyone running into these issues install the latest 2.1 and 2.2 SDKs that 2017 supports, which is currently 2.1.505 and 2.2.105. 2.1.505 should be installed by the latest VS 2017, but 2.2.105 will need to be installed manually.
If anyone is seeing the 2019 install remove older 2.1 and 2.2 SDKs, please let us know as that should not be happening (that is not what I'm observing either).
I'm working with the team on how we can do a better job of communicating this information to our users.
@jgunzy as to your original issue, would you mind providing a dotnet --info? I suspect the only 2.1 SDK you have installed is 2.1.602, which VS 2017 won't use, but I want to confirm.
If that is the case, did you uninstall the 2.1 SDK installed by 2017 manually or did it just disappear on you?
Here is the dotnet info. I did uninstall the other 2.1 SDKs, but only after I started having the issue. I uninstalled them all and just reinstalled the latest from the Microsoft .Net Core website. Windows settings is showing I have 2.1.602 SDK installed but it’s not showing in the info below.
.NET Core SDK (reflecting any global.json):
Version: 2.2.202
Commit: 8a7ff6789d
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.202\
Host (useful for support):
Version: 2.2.3
Commit: 6b8ad509b6
.NET Core SDKs installed:
2.2.100 [C:\Program Files\dotnet\sdk]
2.2.202 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
@jgunzy that's very unexpected. Is there a C:\Program Files\dotnet\sdk\2.1.602 directory or a C:\Program Files (x86)\dotnet\sdk\2.1.602 (the latter would be if you installed a x86 SDK by mistake)?
Do you remember if you had a 2.1.505 SDK installed prior to installing VS 2019?
If you manually install 2.1.505, does it resolve your issue?
Ok looks like I installed the x86 SDK of 2.1.602 by mistake. Removed that.
I had a few different versions of 2.1 SDK prior to installing VS2019 but I can’t remember if 2.1.505 was one of them.
I manually installed 2.1.505 and the problem persists.
Here is my latest dotnet info:
.NET Core SDK (reflecting any global.json):
Version: 2.2.202
Commit: 8a7ff6789d
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.202\
Host (useful for support):
Version: 2.2.3
Commit: 6b8ad509b6
.NET Core SDKs installed:
2.1.505 [C:\Program Files\dotnet\sdk]
2.2.100 [C:\Program Files\dotnet\sdk]
2.2.202 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
From: Peter Huene
Sent: Friday, 5 April 2019 9:07 AM
To: dotnet/sdk
Cc: jgunzy; Mention
Subject: Re: [dotnet/sdk] Build errors in VS2017 after installing VS2019(#3076)
@jgunzy that's very unexpected. Is there a C:\Program Files\dotnet\sdk2.1.602 directory or a C:\Program Files (x86)\dotnet\sdk2.1.602 (the latter would be if you installed a x86 SDK by mistake)?
Do you remember if you had a 2.1.505 SDK installed prior to installing VS 2019?
If you manually install 2.1.505, does it resolve your issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
I haven't yet been able to reproduce. I uninstalled every .NET Core SDK on the system. I reinstalled the .NET Core SDKs via the 2017 (15.9.11) installer; this installed a 2.0 SDK (2.1.202) and a 2.1 SDK (2.1.505).
I was then able to build 2.1 targeted projects. I manually installed SDK 2.2.105 and was then able to build
netcoreapp2.2projects in 2017.I reinstalled the .NET Core SDKs via the 2019 (16.0.0) installer. This installed 2.2.202 and 2.1.602. Both the previous 2.1 SDK installed by 2017 and the 2.2 SDK I manually installed remained.
I reopened the project in 2017 and was able to build with both a
netcoreapp2.2and anetcoreapp2.1TFM.
JUST FOLLOW THIS METHOD. I hand installed all of the ones recommended here in order to get it to start working again all 2.2 and 2.1 apps.
I have run into a similar issue. After installing VS2019, in our estimation, for the most part, our VS2017 solution build pipeline works fine. However, is falling over failing to properly identify our internal dotnet CLI tool. This was working seamlessly prior to the side by side installation. The only thing we can figure, is that the latest runtime bits, 3.0, do not function with well with our netcoreapp2.1 targeted dotnet CLI tool.
So... Looking for workarounds, resolutions. Besides potentially need to install and/or re-install SDKs, runtimes, etc. Haven't gotten quite that far in my troubleshooting. Short of that, crude answer is for us to visit each of our .csproj project files and add the ToolsVersion attribute in the appropriate version? I assume that's 15.0 for VS2017? Is there a more elegant way to do that in swath? i.e. through Directory.Build.props, for instance, by convention, as contrasted with by specification?
Well, I've tried adding ToolsVersion="15.0" to our projects, to no avail.
Running the latest NuGet: Version: 5.3.0.6260
If it helps, our dotnet --info looks like this:
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100\
Host (useful for support):
Version: 3.0.0
Commit: 7d57652f33
.NET Core SDKs installed:
2.1.104 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.401 [C:\Program Files\dotnet\sdk]
2.1.402 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
2.1.500 [C:\Program Files\dotnet\sdk]
2.1.502 [C:\Program Files\dotnet\sdk]
2.1.503 [C:\Program Files\dotnet\sdk]
2.1.504 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.507 [C:\Program Files\dotnet\sdk]
2.1.508 [C:\Program Files\dotnet\sdk]
2.1.509 [C:\Program Files\dotnet\sdk]
3.0.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
@mwpowellhtx Can you open a new issue specific to the problems you're having with dotnet CLI tools? This issue has been dormant for 6 months, so I believe it has been resolved and I am going to close it.
@dsplaisted Thanks, we have resolved the issue, sort of, but there remains some migration path concerns we'd like to understand better.
Most helpful comment
@diedona that's the correct place for your issue too; ideally we'd have the issues in only
dotnet/cli, but it's the same team that owns both repos and we track both issue lists together.So it appears we're not doing a good job of communicating the fact that 2.1.602 and 2.2.202 require MSBuild 16 and that is only available in 2019. Thus those SDKs aren't getting resolved by 2017 because it uses MSBuild 15.
We recommend anyone running into these issues install the latest 2.1 and 2.2 SDKs that 2017 supports, which is currently
2.1.505and2.2.105. 2.1.505 should be installed by the latest VS 2017, but 2.2.105 will need to be installed manually.If anyone is seeing the 2019 install remove older 2.1 and 2.2 SDKs, please let us know as that should not be happening (that is not what I'm observing either).
I'm working with the team on how we can do a better job of communicating this information to our users.