Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何调试MSBuild依赖项问题?_C#_Visual Studio_Msbuild_C++ Cli - Fatal编程技术网

C# 如何调试MSBuild依赖项问题?

C# 如何调试MSBuild依赖项问题?,c#,visual-studio,msbuild,c++-cli,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" (3

我们有一个混合的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).

但我不知道为什么当devenv能够正确使用deps时,它会这样做

是否有人知道其他开关/工具/任何东西或在日志中查找什么来确定如何修复此问题?

用建模SDK替换后,问题消失了


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

您是如何设置/M值的?如果只使用几个进程,如:msbuild xxx.proj/maxcpucount:3,结果如何?ds将提供详细的摘要,您也可以在您的侧边查看。还请检查该问题的生成顺序(多次生成):/m使用8个实例,但它也发生在/m:2上,当然概率较小。我想我以前读过那篇文章。我们没有任何.sln文件依赖项。关于64位MSBuild版本的段落是否仍然有效?是否只有混合解决方案存在此问题?您是使用32位版本还是不同的平台目标构建它?你能在这里分享一个简单的样品吗?至少我不能在一个小的混合测试溶液中复制它。一定很特别。它会自动选择64位MSBuild。看起来此包是根本原因:将其替换为建模SDK的。目标看起来很有希望。
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).