工具版本“ 15.0”无法识别-Visual Studio 2019(v16.0.0 Preview 5.0)中的项目不兼容/未加载

Dim*_*tri 6 c# ide asp.net-mvc csproj visual-studio-2019

更新

  • 还修复了.NET Core 2.1安装的2.2版
  • 卸载VS 2019并重新安装
  • 它确实可以在安装了VS 2017和VS 2019的另一台计算机上工作(相同版本)

更新

我已经面对了很长一段时间,我真的很想利用VS的2019版本。

当打开在Azure DevOps上并且适用于所有以前版本(2015-2017)的VS C#MVC项目时,在2019年将无法正常工作。

我得到的第一个错误是:

.csproj : error  : The tools version "15.0" is unrecognized. Available tools versions are "14.0", "2.0", "3.5", "4.0".
Run Code Online (Sandbox Code Playgroud)

因此,我将15.0逐步更改为建议的15.0,并尝试重新加载项目,但没有一个解决错误,实际上我得到了另一个,如下所示:

.csproj : error  : The application for the project is not installed
Run Code Online (Sandbox Code Playgroud)

不知道我可以/应该在这里做什么...任何人都可以向我建议任何东西,有关于它的信息等等?

谢谢!

小智 12

我遇到过类似的问题,并且在ms docs上有一条记录:

https://docs.microsoft.com/zh-CN/visualstudio/msbuild/updating-an-existing-application?view=vs-2017

使我找到了答案。

如果您安装了Visual Studio的任何旧版本,则在2017年之前,您会在Evil Gac上安装一些不需要的dll。您应该使用以下步骤将其删除:

  1. 在poweshell上运行:gacutil.exe -l | 选择字符串模式'Build'| Select-String -Pattern'Version = 15'

  2. 删除所有找到的条目。例:

    gacutil.exe / u“ Microsoft.Build.Framework,版本= 15.1.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a,processorArchitecture = MSIL”

这将确保vs将使用其当前版本来加载项目。请注意,VS 2019将始终使用``当前''并且将忽略ToolsVersion,除非您强制将其强制为:

https://docs.microsoft.com/zh-cn/visualstudio/msbuild/overriding-toolsversion-settings?view=vs-2019

干杯,马可


Dim*_*tri 8

好的修复了这个......

我的 Visual Studio 2017 MSBuild 位置:

C:\Program Files (x86)\Microsoft Visual Studio\Enterprise\MSBuild\15.0\Bin
Run Code Online (Sandbox Code Playgroud)

我的 Visual Studio 2019 MSBuild 位置:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin
Run Code Online (Sandbox Code Playgroud)

我注意到我的 Visual Studio 2019 Bin 文件夹不完整,所以我继续备份(当然)并从 2017 年到 2019 年复制了完整的 Bin 文件夹。

这解决了所有问题......不知道在这里多说什么,只希望它可以帮助任何人!

  • 我终于得到了一个对我有用的答案。https://developercommunity.visualstudio.com/content/problem/799309/installing-vs2019-with-existing-vs2017-wont-allow.html?childToView=801429#comment-801429。上面的答案并没有解决 GAC 中造成主要问题的二进制文件。 (2认同)