I believe the problem is documented here moved here and looks like it might be a bug in visual studio, but I'm wondering if anyone knows of a workaround.
Basically I have the following two lines (among other things) one right after the other in the prebuild event.
"C:WINDOWSMicrosoft.NETFrameworkv3.5MSBuild.exe" /p:configuration=Release;platform=x86 /t:rebuild "$(SolutionDir)Folder1Project1.csproj"
"C:WINDOWSMicrosoft.NETFrameworkv3.5MSBuild.exe" /p:configuration=Release;platform=x86 /t:rebuild "$(SolutionDir)Folder2Folder3Project2.csproj"
The first one succeeds and the other fails saying that The command ""C:WINDOWSMicrosoft.NETFrameworkv3.5MSBuild.exe" /p:configuration=Release;platform=x86 /t:rebuild "*Undefined*Folder2Folder3Project2.csproj"" exited with code 1.
.
Edit:
Figured out the problem was that one of the other projects with the same line as it's prebuild failed, since MSBuild itself doesn't know about the macros.
question from:
https://stackoverflow.com/questions/635346/prebuild-event-in-visual-studio-replacing-solutiondir-with-undefined 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…