There are quite a few SO questions about binding-redirects but none that explain why the assembly loader might fail to match a revision for a dll that looks like it clearly should match.
My project is failing at runtime with "Could not load file or assembly". The FusionLog property of the inner exception reads:
=== Pre-bind state information ===
LOG: DisplayName = Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
(Fully-specified)
LOG: Appbase = file:///D:/work/code/b6/Backend/CSharp/Applications/Web/Ingestion/Backend/csx/Debug/roles/WorkerRole1/approot
LOG: Initial PrivatePath = D:\work\code\b6\Backend\CSharp\Applications\Web\Ingestion\Backend\csx\Debug\roles\WorkerRole1\approot
Calling assembly : Microsoft.Azure.Cosmos.Table, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\work\code\b6\Backend\CSharp\Applications\Web\Ingestion\Backend\csx\Debug\roles\WorkerRole1\approot\WorkerRole1.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 10.0.0.0 redirected to 11.0.1.21818.
LOG: Post-policy reference: Newtonsoft.Json, Version=11.0.1.21818, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: Attempting download of new URL file:///D:/work/code/b6/Backend/CSharp/Applications/Web/Ingestion/Backend/csx/Debug/roles/WorkerRole1/approot/Newtonsoft.Json.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
These lines
LOG: Redirect found in application configuration file: 10.0.0.0 redirected to 11.0.1.21818
...
file:///D:/work/code/b6/Backend/CSharp/Applications/Web/Ingestion/Backend/csx/Debug/roles/WorkerRole1/approot/Newtonsoft.Json.DLL
indicate that the binding I have set is being applied and that the loader is examining the expected dll.
Looking at the dll properties (from that path) I see that the version matches the redirection...
but I'm still getting this mismatch
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
I've also verified the PublicKeyToken is as expected using the sn tool.
Can anyone suggest what might be going on here? All I can think of is that the FusionLog output is incorrect/incomplete and a different dll is actually being examined.