相关文章推荐
笑点低的荒野  ·  SQL Expressions, ...·  1 年前    · 
大方的人字拖  ·  stimulsoft ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

Ask Question
  • 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?

    Which .NET framework version does it need because mine is targeting 4.6.1 but i get following error: "Could not install package 'Microsoft.Build 16.0.461'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework." Dimitri Apr 9, 2019 at 9:44 I have installed not the latest but just the one before it (15.xxxx) but after building, closing the solution and re-opening it I still have the same error. Dimitri Apr 9, 2019 at 9:53

    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:

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

  • 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

    I previously had used this solution developercommunity.visualstudio.com/content/problem/411464/… but this stoped working after some smaller Visual Studio update later, where classes were no longer recognized and could not be navigate to any longer. I removed the system path and applied this solution and now it works again. Thank you very much. RonnyR Jun 11, 2019 at 9:27 Thanks! This answer solved a 3 hour witch hunt for not getting basically anything working in VS2019 for me jsmars Aug 30, 2019 at 20:16 Since this is non-obvious to do in VS 2017 (there are no powershell prompts in VS 2017), as per intellitect.com/enter-vsdevshell-powershell install the github.com/Pscx/Pscx cmdlet (allow clobber if prompted), which will grant you access to gacutil.exe after you run Invoke-BatchFile "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat" - I didn't edit the answer because the OP's question covers 2019, I'm interested in 2017, hope this helps someone. smaudet Mar 16, 2021 at 15:44

    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!

    Please try and create one to see if you get the same as me because I followed the same steps and my VS2019 with .NET Core 3.0 is broken. – Dandré Oct 30, 2019 at 6:57 I am on another install of windows and haven't had any issues anymore so I'm not going to be able to do this. Everything works fine now. What is broken or what issue do you have? – Dimitri Oct 30, 2019 at 8:36 Thanks but don't stress. I just wanted to find out if you have issues working on .NET Core 3.0 like me since I followed the steps that you laid out in this answer. I have logged it with Microsoft in the mean time. I can't do anything. Can't create projects or even open existing ones. VS2017 worked perfectly. – Dandré Oct 30, 2019 at 20:10 I finally got an answer that worked for me. developercommunity.visualstudio.com/content/problem/799309/…. The answer above doesn't address the binaries in the GAC that are the culprits to the main problem. – Dandré Oct 31, 2019 at 16:04

    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.

    Upgrading from MSVS2017 to MSVS2019, and then opening a MSVS2017 project may result with error "The application for the project is not installed"

    Try the following to fix the error

  • Close MSVS2019
  • Open Explorer > [Project Folder]/.vs/[Project Name]
  • Delete v15 subfolder
  • Open MSVS2019 > Project (should now open)
  • Right click on Solution Explorer > Project
  • Select Retarget Projects
  • In my system I have VS 2017, 2019 and 2022 installed along with .Net Core 6. Not sure what suddenly caused build failures in one of the solution developed in VS 2017 and all the projects were not loading in any of VS. The erro was something related to MS build path.

    Below solution helped in resolving the issue. Open the Developer command prompt for Visual Studio 2019 and execute the below command:

    SETX MSBUILD_EXE_PATH "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe"
    

    We can add multiple MS build paths for multiple Visual Studios separated by ; in above command.

    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Jeremy Caney Apr 15 at 0:22

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.