此工具集不支持 TargetFrameworkVersion 'v4.5.1' (ToolsVersion: 4.0)

TargetFrameworkVersion 'v4.5.1' not supported by this toolset (ToolsVersion: 4.0)

当尝试使用 .NET 4.5.1 在 Visual Studio Code on Linux Mint using Mono version 4.0.2 中打开控制台项目时,输出中显示以下警告 Window:

/home/freeman/Projects/SleepyThread/SleepyThread/SleepyThread.csproj: warning : Project has unknown ToolsVersion '14.0'. Using the default tools version '4.0' instead.

/home/freeman/Projects/SleepyThread/SleepyThread/SleepyThread.csproj (default targets) -> [WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] TargetFrameworkVersion 'v4.5.1' not supported by this toolset (ToolsVersion: 4.0). /home/freeman/Projects/SleepyThread/SleepyThread/SleepyThread.csproj /usr/lib/mono/4.5/Microsoft.Common.targets(0,0): Warning: TargetFrameworkVersion 'v4.5.1' not supported by this toolset (ToolsVersion: 4.0).

dnvm list 输出:

  • 1.0.0-beta5 mono ~/.dnx/runtimes default

关于接近的投票:我忘了问实际问题,但我认为很明显问题是如何修复警告。

将 *.csproj 文件中的 ToolsVersion 更改为 4.0 会删除警告:

Project has unknown ToolsVersion '14.0'

将项目设置从 .NET 4.5.1 降级到 .NET 4.5 会删除警告:

TargetFrameworkVersion 'v4.5.1' not supported by this toolset ToolsVersion: 4.0