什么是程序集绑定日志中的后策略引用?

时间:2015-10-12 23:12:32

标签: .net .net-assembly fuslogvw

试图理解这个程序集绑定失败 - 下面的日志中“后策略引用”的含义是什么?

LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\approot\WorkerRole.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from D:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Diagnostics, Version=2.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///E:/approot/Microsoft.WindowsAzure.Diagnostics.DLL.
LOG: Assembly download was successful. Attempting setup of file: E:\approot\Microsoft.WindowsAzure.Diagnostics.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

我在代码中没有看到任何引用该DLL的内容,因此试图弄清楚发生了什么。

1 个答案:

答案 0 :(得分:3)

我的理解是“发布后政策参考”是发布商政策和一般装配重定向之后的装配参考。有关示例,请参阅https://indexoutofrange.com/Could_not_load_file_or_assembly_or_one_of_its_dependencies/

关于加载此dll的原因,您从日志中获取的片段缺少相关行。在上面的行

LOG: This bind starts in default load context.

应该有像

这样的东西
Calling assembly : XYZ.

引用引用Microsoft.WindowsAzure.Diagnostics的程序集。再次查看上一个链接以获取示例。