1

I've recently made the switch from Visual Studio 2017 to 2019. However, I'm unable to get any projects to load. When I load a solution, each project within that solution shows up as "unloaded" in the solution explorer. Right-clicking and selecting "reload" produces one of the following errors:

C:\<path>\<file>.csproj : error : The tools version "15.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0". C:\<path>\<file>.csproj

for projects which specify a tools version, or

C:\<path>\<file>.csproj : error : The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.

for projects which specify an SDK.

Several related questions have suggested modifying a global.json file, un/reinstalling MSBuild, setting PATH to point to the Program Files/dotnet folder, or installing the latest SDK. I have the latest version of the .NET core SDK installed as well as many others, and my PATH environment variable is pointing to Program Files/dotnet. I don't have the nefarious MSBuild 15 installed and adding global.json files did not resolve any projects.

These are all projects which loaded in other copies of VS 2019 as well as VS 2017. I'm at a loss as to what to do. All help is appreciated.

2
  • Do you have both IDEs installed at the same time? thats caused problems for me before. also its likely the SDKs in question are more than just the .Net Core. if you edit the project file, what references is it indicating? Jun 26, 2020 at 23:17
  • @FrankThomas I did have 2017 and 2019 installed, and 2017 continued to work fine but 2019 never worked. I uninstalled 2017 using the VS installer and deleted all but the most recent SDK. The issue occurs even on projects with no additional references besides some System namespaces.
    – params
    Jun 27, 2020 at 14:11

1 Answer 1

0

Self-answering in case this occurs to anyone else.

The issue at hand was that there were some old (and buggy) versions of MSBuild floating around on my system. This was complicated by the fact that gacutil -l would only list these assemblies when certain environment variables were set. Digging around in my global assembly cache, I was able to find them at Windows\Microsoft.NET\assembly\GAC_MSIL under several different folders which started with Microsoft.Build. Any sub-folders or files which contained the nebulous version number 15 I deleted. Restarted VS 2019 and the issue was gone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.