本文介绍了MSBuild和< AutoUnifyAssemblyReferences/>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"Microsoft.Bcl.Build.targets"包含以下块:

The "Microsoft.Bcl.Build.targets" contains this block:

    <!--
  Workaround MSBuild issue that prevents System.Runtime 2.5 and System.Threading.Tasks 2.5 from
  satisfying indirect dependencies on System.Runtime 1.5 and System.Threading.Tasks 1.5 respectively.
-->
<AutoUnifyAssemblyReferences>false</AutoUnifyAssemblyReferences>

"AutoUnifyAssemblyReferences"实际上做什么?

What actually "AutoUnifyAssemblyReferences" do?

推荐答案

它直接映射到 ResolveAssemblyReferencs-任务.

It maps directly to the AutoUnify parameter of the ResolveAssemblyReferencs-Task.

文档摘录:

为true时,生成的依赖关系图将自动视为 是否有传入AppConfigFile的App.Config文件 参数.此虚拟App.Config文件具有一个bindingRedirect条目,用于 每个有冲突的程序集集,以使最高版本 程序集被选中,其结果是将永远不会 警告有冲突的程序集,因为每次冲突都会 已解决.

When true, the resulting dependency graph is automatically treated as if there were anApp.Config file passed in to the AppConfigFile parameter.This virtual App.Config file has a bindingRedirect entry for each conflicting set of assemblies such that the highest version assembly is chosen.A consequence of this is that there will never be a warning about conflicting assemblies because every conflict will have been resolved.

为true时,每个不同的重映射将导致较高的优先级 注释,其中显示了旧版本和新版本,并且AutoUnify是正确的.

When true, each distinct remapping will result in a high priority comment showing the old and new versions and that AutoUnify was true.

为true时,AppConfigFile参数必须为空

When true, the AppConfigFile parameter must be empty

为false时,将不会进行程序集版本的重新映射 自动.当存在两个版本的程序集时,将显示警告 发出.

When false, no assembly version remapping will occur automatically.When two versions of an assembly are present, a warning is issued.

为false时,不同版本的 相同的程序集会产生高优先级的注释.这些注释是 紧接着是一个警告.警告具有唯一的错误代码和 包含的文本显示为发现不同版本之间存在冲突 参考和从属程序集".

When false, each distinct conflict between different versions of the same assembly results in a high-priority comment.These comments are followed by a single warning.The warning has a unique error code and contains text that reads "Found conflicts between different versions of reference and dependent assemblies".

突出显示的句子似乎可以解释您所引用的Microsoft.Bcl.Build.Targets中的评论.

The highlighted sentence seems to explain the comment in Microsoft.Bcl.Build.Targets you refer to.

(此参数还会影响不少见的 MSB3247警告.)

(This parameter also influences the not uncommon MSB3247 warning.)

因此对于某些类型的"exe"程序集,AutoUnifyAssemblyReferences的默认值设置为false,对于其他程序集类型,其设置为true(有关详细信息,请参见%Windir%\Microsoft.NET\Framework64\v4.0*\Microsoft.Common.Targets).

The defaults for the AutoUnifyAssemblyReferences is therefor set to false for certain types of "exe" assemblies and to true for other assembly types (see %Windir%\Microsoft.NET\Framework64\v4.0*\Microsoft.Common.Targets for details).

这篇关于MSBuild和&lt; AutoUnifyAssemblyReferences/&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 02:45