c# - VS 2015 工具集可能未知或缺失

标签 c# asp.net visual-studio-2015 msbuild

我尝试将项目发布到我的文件目录。

我收到了这条消息。但是没有显示任何错误。错误列表为空。

2> Building with tools version "14.0".

2> Project file contains ToolsVersion="12.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="14.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=293424. 2> Target "ValidateMSBuildToolsVersion" skipped. Previously built unsuccessfully. 2>Done building project "project_name.csproj" – FAILED. 2> ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

最佳答案

VS 2015 Toolset may be unknown or missing

根据错误信息“Project file contains ToolsVersion="12.0".”,说明你的项目是从Visual Studio 2013升级过来的,所以当你用Visual Studio 2015发布的时候,你可能会收到此错误“此工具集可能未知或丢失...

要解决这个问题,您可以尝试更新您的项目文件:右键您的项目->卸载项目->编辑您的项目名称.csproj->将ToolsVersion="12.0"更改为第二行的 ToolsVersion="14.0"

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

如果您使用 MSBuild 命令行构建您的项目,您可以使用命令提示符覆盖项目和解决方案的 ToolsVersion 设置:

msbuild.exe someproj.proj /tv:14.0

关于c# - VS 2015 工具集可能未知或缺失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48296874/

相关文章:

c# - 当 Action Filter 创建响应时,不会调用 ASP.NET Web API Exception Filter

c# - C#中的'->'运算符,它有什么作用?

c# - 在两个服务的构造函数之间检测到循环依赖

c# - Silverlight 数据表单验证不起作用

c# - User.IsInRole() 在 MVC C# 类中工作

asp.net - 在新窗口中写入输出流

c# - ASP.NET : Possible to create a UserControl that include inside markup content?

c# - 循环遍历 Entity Framework 6 中的表格

c++ - 系统找不到指定的文件 Visual Studio 2015

c++ - 使用 CodeSynthesis XSD 编译有效的 XML 模式失败并出现错误 MSB3721