Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The tools version "15.0" is unrecognized - Incompatible/Unloaded project in Visual Studio 2019 (v16.0.0 Preview 5.0)

UPDATES

  • Repaired .NET Core 2.1 installed version 2.2 as well
  • uninstalled VS 2019 and re installed
  • it does work on another machine with VS 2017 & VS 2019 installed (same versions)

UPDATES

I am facing this for quite a while and I really want to make use of the 2019 Version of VS.

When opening a VS C# MVC project that is on Azure DevOps and works on all previous versions (2015-2017) is not working in 2019.

The first error I get is:

.csproj : error : The tools version "15.0" is unrecognized. Available tools versions are "14.0", "2.0", "3.5", "4.0".

So I change the 15.0 to the suggested ones one by one and tried reloading the project, none solved the error, in fact I am getting another which is the following:

.csproj : error : The application for the project is not installed

No idea what I can/should do here.

Anyone can suggest me anything, has some info about it and so on?

like image 230
Dimitri Avatar asked Apr 09 '19 09:04

Dimitri


3 Answers

I've experienced a similar problem and one entry on ms docs:

https://learn.microsoft.com/en-us/visualstudio/msbuild/updating-an-existing-application?view=vs-2017

has lead me to the answer.

If you ever had any older versions of visual studio installed, prior than 2017 you will have some unwanted dlls installed on the evil gac. You should remove it by using these steps:

  1. On poweshell run: gacutil.exe -l | Select-String -Pattern 'Build' | Select-String -Pattern 'Version=15'

  2. Remove all found entries. Example:

    gacutil.exe /u "Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"

This will make sure that vs will use it's current version to load the projects. Please note that VS 2019 will always use "Current" and will ignore the ToolsVersion unless you force it to:

https://learn.microsoft.com/en-us/visualstudio/msbuild/overriding-toolsversion-settings?view=vs-2019

like image 143
Marco Avatar answered Oct 22 '22 13:10

Marco


OK FIXED THIS ...

My visual studio 2017 MSBuild location:

C:\Program Files (x86)\Microsoft Visual Studio\Enterprise\MSBuild\15.0\Bin

My visual studio 2019 MSBuild location:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin

I noticed that my Visual studio 2019 Bin folder was incomplete so i went on and took a back up (of course) and copied the complete Bin folder from 2017 to 2019.

This fixed everything ... No idea what to say more here, just hopes it can help anyone!

like image 8
Dimitri Avatar answered Oct 22 '22 12:10

Dimitri


I have had the same exact issues with my attempted upgrade to VS 2019. However, what I have read is that the MSBuild version is supposed to correspond to the Visual Studio version. Hence, VS2017=MSBuild 15.x, VS2019=MSBuild 16.x.

When I installed both VS2019 and MSBuild 16.x at no time did I see in my GAC a build version for 16.x. For both VS2017 and VS2019 installs, the build versions were always at 15.0.

So far, I have had to return to my version of VS2015, which runs all my projects as expected. Not sure what to do since I couldn't get any help from Microsoft technical support without paying $500.00.

like image 3
Steve Naidamast Avatar answered Oct 22 '22 13:10

Steve Naidamast