visual-studio-2013 - Visual Studio MSBuild 错误

标签 visual-studio-2013 msbuild

我安装了 Visual Studio 2013。
以前我的项目是在 VS 2010 中构建的。

我在 VS 2013 中打开了我的项目,该项目已自动更新。
我还更新了项目构建选项以使用 .Net 4.5.3 而不是 4.0。

项目构建和运行没有错误。
但是我看到了 100 多个我以前从未见过的警告——所有这些都与 Microsoft.Common.CurrentVersion.target 文件有关。

例如,第一个警告是:

The 'TreatAsLocalProperty' attribute is not declared.

我不熟悉 Microsoft.Common.CurrentVersion.target 文件。当我检查警告时,我看到这个文件来自 msbuild\12.0\bin 目录。

我看到我还有一个 msbuild\14.0\bin 目录,尽管那里的文件看起来非常相似。我想这可能是作为 VS 2013 安装的一部分安装的——也许我应该使用那个版本的 msbuild(?)——但我不确定在哪里改变它,也不确定这会解决问题。我将 .csproj 文件更改为引用版本 14:
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

但这没有效果。

也许项目中还需要包含其他内容?

最佳答案

这个链接帮助了我 microsoftcommontargets errors and over a hundred warnings . Cool Coyote 的回答成功了:

I had this error appear 1 day after rearranging a large project. I finally solved the problem by closing down every source window. I had been veiwing references in my project and had a fair few windows open. When everything was closed I tried a run , which built and run ok to my surpise with absolutely no warnings. I find the environment does get corrupt now and then, usually a restart does the trick but in this case thr problem just repeated. Cleaning the ide by closing the window takes the memeory load of the ide, Im suspicious of internal corruptions when this sort of thing happens.



所以我关闭了所有的源窗口,做了一个解决方案>清理,一个解决方案>重建......没有更多的警告!

关于visual-studio-2013 - Visual Studio MSBuild 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27573141/

相关文章:

c# - Visual Studio IIS HTTP 503 服务不可用

c# - 如何根据tfs项目构建号设置AssemblyInfo.cs?

azure - 从 VS 2013 管理 Azure 存储

c++ - 在 C++ Windows 应用程序中引用 native C++ DLL 仅在添加为引用时有效

c++ - 如何在 Visual Studio 的 C/C++ 项目中遵循#include 语句

c# - 如何在 C# 中以编程方式构建解决方案?

MSBuildWorkspace 无法将带有 <ProjectReference> 的项目编译到另一个项目

c# - 阅读 msbuild 语法

visual-studio - 如果MSBuild编译从命令行成功,则在 Debug模式下运行解决方案

visual-studio - 如何在 msbuild 任务中获取发布配置文件名称?