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.
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:
With respect to why this dll is loaded then you snippet from the log is missing the relevant line. On the line just above
there should be something like
referencing the assembly that has a reference to
Microsoft.WindowsAzure.Diagnostics. Again see the previous link for examples.