Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Post-Policy reference in assembly binding log?

Trying to understand this assembly binding failure - What is the meaning of "Post-policy reference" in the log below?

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.

Nothing I can see in my code references that DLL so trying to figure out what is going on.

like image 204
noctonura Avatar asked Oct 12 '15 23:10

noctonura


People also ask

What is a post policy reference?

My understanding is that "Post-policy reference" is the assembly reference after publisher policies, and in general assembly redirections, have occured.

What is Assembly binding logging?

ASP.NET Framework has fusion Assembly Binding logging (aka Fusion Logging) which allows you to debug assembly load failures in your . NET applications. Fusion logging comes handy when your application is referencing assemblies or external nuget packages and you are encountering assembly binding failures.

What is Fuslogvw?

The Assembly Binding Log Viewer (Fuslogvw.exe) uses the Internet Explorer (IE) cache to store its binding log.


1 Answers

My understanding is that "Post-policy reference" is the assembly reference after publisher policies, and in general assembly redirections, have occured. See for instance https://indexoutofrange.com/Could_not_load_file_or_assembly_or_one_of_its_dependencies/ for some examples.

If a redirect was specified, the fusion log will look like this:

...
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
...

With respect to why this dll is loaded then you snippet from the log is missing the relevant line. On the line just above

LOG: This bind starts in default load context.

there should be something like

Calling assembly : XYZ.

referencing the assembly that has a reference to Microsoft.WindowsAzure.Diagnostics. Again see the previous link for examples.

like image 159
Mikkelbu Avatar answered Dec 25 '22 04:12

Mikkelbu