我们有一个混合的C#和C++/CLI解决方案。使用devenv构建可以正常工作,通过
msbuild /nr:false /t:Rebuild /p:Configuration=Release /p:Platform=x64 Solution.sln
在添加 /m 后,程序可以正常工作,但是会出现失败。例如使用 cl 或 link 命令时,由于 .pch 或 .obj 文件已在使用中,导致命令执行失败。
通过诊断输出,我发现某些项目由于某种原因被多次构建:
1>Project "Solution.sln" (1)
is building "a.vcxproj" (34) on node 2 (default targets).
34>Project "a.vcxproj" (34)
is building "b.vcxproj" (43:2) on node 5 (default targets).
33>Project "c.csproj" (33)
is building "c.csproj" (33:2) on node 6 (ResolveReferences;_CopyFilesMarkedCopyLocal target(s)).
33:2>Project "c.csproj" (33:2)
is building "d.csproj" (41) on node 2 (default targets).
41>Project "d.csproj" (41)
is building "d.csproj" (41:2) on node 2 (ResolveReferences;_CopyFilesMarkedCopyLocal target(s)).
41:2>Project "d.csproj" (41:2)
is building "b.vcxproj" (43) on node 2 (default targets).
.
1>Project "Solution.sln" (1)
is building "e.vcxproj" (60) on node 5 (default targets).
1>Project "Solution.sln" (1)
is building "f.csproj" (69) on node 6 (default targets).
69>Project "f.csproj" (69)
is building "f.csproj" (69:2) on node 6 (ResolveReferences;_CopyFilesMarkedCopyLocal target(s)).
69:2>Project "f.csproj" (69:2)
is building "e.vcxproj" (60:2) on node 6 (default targets).
但我不知道为什么当devenv能够正确获取依赖项时它会表现出这种行为。
有人知道其他的开关/工具/或者需要在日志中查找什么来解决这个问题吗?