-
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
Build errors in VS2017 after installing VS2019 #3076
Comments
@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. |
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 |
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] dotnet --info Runtime Environment: Host (useful for support): .NET Core SDKs installed: .NET Core runtimes installed: To install additional .NET Core runtimes or SDKs: |
@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 |
@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" |
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 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 |
@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 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 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 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: 8a7ff67
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 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: 8a7ff67
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\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?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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 |
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 |
Well, I've tried adding Running the latest NuGet: If it helps, our
|
@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. |
…build 20191004.11 (dotnet#3076) - Microsoft.NET.Sdk.Razor - 3.0.1-servicing.19504.11
) * fixes dotnet/templating#2897 integration tests for --search
) * fixes dotnet/templating#2897 integration tests for --search
) * fixes dotnet/templating#2897 integration tests for --search
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.
The text was updated successfully, but these errors were encountered: