运行msbuild Foo。sln /t:Rebuild /v:diag(来自C:\Program Files (x86)\MSBuild\12.0\ bin)从命令行构建解决方案并获得更多详细信息,然后找到.csproj. diag文件。它将记录警告并检查其引用以及使用相同公共程序集但版本不同的其他项目的引用。
编辑:你也可以在VS2013中直接设置构建细节。转到工具>选项菜单,然后转到项目和解决方案,将MSBuild verbose设置为诊断。
编辑:有些澄清,因为我自己也有一个。在我的例子中,警告是由于我使用Resharper提示符添加引用,而不是添加引用对话框,这使得它无版本,即使v4和v12都可以选择。
<Reference Include="Microsoft.Build, Version=12.0.0.0, ..." />
<Reference Include="Microsoft.Build.Framework" />
vs
<Reference Include="Microsoft.Build, Version=12.0.0.0, ..." />
<Reference Include="Microsoft.Build.Framework, Version=12.0.0.0, ..." />
在使用/v:diag的MSBuild日志中,它看起来如下所示。给出两个引用相冲突的细节:-
There was a conflict between
"Microsoft.Build.Framework, Version=4.0.0.0, ..." and
"Microsoft.Build.Framework, Version=12.0.0.0, ...". (TaskId:16)
"Microsoft.Build.Framework, Version=4.0.0.0, ..." was chosen because it was primary and
"Microsoft.Build.Framework, Version=12.0.0.0, ..." was not. (TaskId:16)
References which depend on "Microsoft.Build.Framework, Version=4.0.0.0, ..."
[C:\...\v4.5.1\Microsoft.Build.Framework.dll]. (TaskId:16)
C:\...\v4.5.1\Microsoft.Build.Framework.dll (TaskId:16)
Project file item includes which caused reference "C:\...\v4.5.1\Microsoft.Build.Framework.dll". (TaskId:16)
Microsoft.Build.Framework (TaskId:16)
References which depend on "Microsoft.Build.Framework, Version=12.0.0.0, ..."
[C:\...\v12.0\Microsoft.Build.Framework.dll]. (TaskId:16)
C:\...\v12.0\Microsoft.Build.dll (TaskId:16)
Project file item includes which caused reference "C:\...\v12.0\Microsoft.Build.dll". (TaskId:16)
Microsoft.Build, Version=12.0.0.0, ... (TaskId:16)
C:\...\v12.0\Microsoft.Build.Engine.dll (TaskId:16)
Project file item includes which caused reference "C:\...\v12.0\Microsoft.Build.Engine.dll". (TaskId:16)
Microsoft.Build, Version=12.0.0.0, ... (TaskId:16)
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3277:
Found conflicts between different versions of the same dependent assembly that could not be resolved.
These reference conflicts are listed in the build log when log verbosity is set to detailed.
[C:\Users\Ilya.Kozhevnikov\Dropbox\BuildTree\BuildTree\BuildTree.csproj]