无法设置msbuild.exe Visual Studio 2010的路径

时间:2013-06-30 10:33:23

标签: c++ visual-studio-2010

我最近开始使用Visual Studio 2010.我遇到以下问题:我的项目无法构建。我收到这个错误:

C:\...\visual studio 2010\Projects\String2\String2\String2.vcxproj : error MSB4014: The build stopped unexpectedly because of an internal failure.
C:\...\visual studio 2010\Projects\String2\String2\String2.vcxproj : error MSB4014: Microsoft.Build.Exceptions.BuildAbortedException: Build was canceled. MSBuild.exe could not be launched as a child node as it could not be found at the location "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe". If necessary, specify the correct location in the BuildParameters, or with the MSBUILD_EXE_PATH environment variable.

我检查了相关目录,确实可以在那里找到MSbuild.exe。环境变量MSBUILD_EXE_PATH中的路径设置为正确的路径。该项目仍然无法建设。有时我可以更改环境变量以在最后包含“/msbuild.exe”,这将起作用。有时它不会。每次重新启动计算机时都会返回问题。

2 个答案:

答案 0 :(得分:0)

按写入in this answer激活诊断并查看其报告的内容。我的经验是,有时报告的错误与真正的原因相差甚远,就像某些文件因为被锁定或目录丢失而无法创建,但它表明了一些msbuild问题。第一道防线是删除输出和中间文件夹。

答案 1 :(得分:0)

我已经解决了这个问题。问题是编译器会干扰防病毒软件(Avast)。如果我打开防病毒软件,编译器就可以了。这显然提出了一个新问题 - 如何在使用编译器时保持防病毒?