gpt4 book ai didi

c# - MSBuild 和

转载 作者:太空狗 更新时间:2023-10-29 22:36:33 42 4
gpt4 key购买 nike

“Microsoft.Bcl.Build.targets”包含此 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”究竟做了什么?

最佳答案

它直接映射到 ResolveAssemblyReferencs-TaskAutoUnify 参数.

文档摘录:

This parameter is used for building assemblies, such as DLLs, which cannot have a normal App.Config file.

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.

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

When true, the AppConfigFile parameter must be empty

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

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 中的注释。

(这个参数也影响并不少见的 MSB3247 warning 。)

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

关于c# - MSBuild 和 <AutoUnifyAssemblyReferences/>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34042189/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com