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

Unable to set path of msbuild.exe Visual Studio 2010

本文关键字:Studio 2010 路径 Visual exe 设置 msbuild      更新时间:2023-10-16

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

C:...visual studio 2010ProjectsString2String2String2.vcxproj : error MSB4014: The build stopped unexpectedly because of an internal failure.
C:...visual studio 2010ProjectsString2String2String2.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:WINDOWSMicrosoft.NETFrameworkv4.0.30319msbuild.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",这将起作用。有时不会。每次重新启动计算机时,问题都会再次出现。

按照这个答案中所写的激活诊断并查看它报告的内容。我的经验是,有时报告的错误与真正的原因相去甚远,比如一些文件由于被锁定而无法创建,或者目录丢失,但它说明了一些msbuild问题。第一道防线是删除输出文件夹和中间文件夹。

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