如何调试MSBuild依赖问题?

时间:2017-01-30 16:07:21

标签: c# visual-studio msbuild c++-cli

我们有一个混合的C#和C ++ / CLI解决方案。建筑与devenv工程,通过

建设
msbuild /nr:false /t:Rebuild /p:Configuration=Release /p:Platform=x64 Solution.sln

工作但添加/ m时失败。例如,cl或链接失败导致.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能够让deps正确时,它的行为就像那样。

是否有人知道其他开关/工具/在日志中查找的内容或内容以确定如何解决此问题?

1 个答案:

答案 0 :(得分:0)

用Modeling SDK替换https://www.nuget.org/packages/Clarius.TransformOnBuild-unofficial/后,问题就消失了。

关于MSBuild“调试”一般来说似乎没有比挖掘详细日志更好的方法/fl /flp:MSBuild.log;verbosity=diagnostic /detailedsummary

相关问题