noc*_*ura 9 .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.
Run Code Online (Sandbox Code Playgroud)
我在代码中没有看到任何引用该DLL的内容,因此试图弄清楚发生了什么.
小智 6
我的理解是“政策后参考”是发布者政策之后的程序集参考,并且在一般程序集重定向发生后。例如,请参阅https://indexoutofrange.com/Could_not_load_file_or_assembly_or_one_of_its_dependencies/以获取一些示例。
如果指定了重定向,则融合日志将如下所示:
...
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 3.2.1.0 redirected to 4.0.0.0.
LOG: Post-policy reference: NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c
...
Run Code Online (Sandbox Code Playgroud)
关于为什么加载此 dll,那么您从日志中提取的片段缺少相关行。就在上面
LOG: This bind starts in default load context.
Run Code Online (Sandbox Code Playgroud)
应该有类似的东西
Calling assembly : XYZ.
Run Code Online (Sandbox Code Playgroud)
引用具有引用的程序集Microsoft.WindowsAzure.Diagnostics。再次查看前面的链接以获取示例。