基本上,在预构建事件中,除其他事项外,我有以下两行代码。
"C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe" /p:configuration=Release;platform=x86 /t:rebuild "$(SolutionDir)Folder1\Project1.csproj"
"C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe" /p:configuration=Release;platform=x86 /t:rebuild "$(SolutionDir)Folder2\Folder3\Project2.csproj"
第一个成功了,而另一个失败了,显示出The command ""C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe" /p:configuration=Release;platform=x86 /t:rebuild "*Undefined*Folder2\Folder3\Project2.csproj"" exited with code 1.
。
编辑:
找到问题所在,是由于其中一个具有相同预构建行的其他项目失败,因为MSBuild本身不知道宏。