假设我们有:
Nuget具有很好的功能,可以自动检测这些程序集冲突,并创建绑定重定向指令。Nuget命令将向测试项目web.config文件添加这样的字符串:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NH" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>现在假设我们有更多的库,引用NH。问题是:识别奇怪版本的最好方法(而不是手动)是什么?
发布于 2013-10-24 16:23:30
要调查绑定错误,可以使用融合日志查看器。
您可以将其配置为日志--所有绑定--这基本上可以让您了解从何处加载程序集。
典型的输出如下所示:
=== Pre-bind state information ===
LOG: DisplayName = graphicfailtest.resources, Version=0.0.0.0, Culture=en-US, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = C:\bla\graphic\cs\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : graphicfailtest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: graphicfailtest.resources, Version=0.0.0.0, Culture=en-US, PublicKeyToken=null
LOG: Attempting download of new URL file:///C:..../graphicfailtest.resources.DLL.
LOG: All probing URLs attempted and failed.https://stackoverflow.com/questions/19496371
复制相似问题