Fusion binding Post-policy ignoring bindingRedirect
Asked Answered
H

2

7

I have a project with SignalR and Ext.net. Both require Newtonsoft.Json.

SignalR requires Newtonsoft.Json 4.5.0.0 and Ext.net requires 4.0.8.0.

My binding redirects are not working at all. In my web.config

<dependentAssembly>
  <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
  <bindingRedirect oldVersion="4.0.8.0" newVersion="4.5.0.0"/>
</dependentAssembly>

But when it goes to bind

=== Pre-bind state information ===
LOG: DisplayName = Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
 (Fully-specified)
LOG: Appbase = file:///C:/Users/*****/Documents/Visual Studio 2012/Projects/QuotaBuilder/branches/1Install/QMSSite/
LOG: Initial PrivatePath = C:\Users\*****\Documents\Visual Studio 2012\Projects\QuotaBuilder\branches\1Install\QMSSite\bin
Calling assembly : Ext.Net, Version=1.6.0.1867, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\*****\Documents\Visual Studio 2012\Projects\QuotaBuilder\branches\1Install\QMSSite\web.config
LOG: Using host configuration file: \\pacrl-fsrv02\userdata$\*****\My Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/862fb004/45708817/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/862fb004/45708817/Newtonsoft.Json/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Users/*****/Documents/Visual Studio 2012/Projects/QuotaBuilder/branches/1Install/QMSSite/bin/Newtonsoft.Json.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

So as far as I can see, the Post-policy reference should be the redirected version, not the original request. Yet it's being completely ignored. I've run into this problem before with this project too, but in the past I've been able to just get the version it's asking for because there weren't two separate dependencies.

Herder answered 23/4, 2014 at 19:12 Comment(0)
M
0

Change your binding redirect to:

<dependentAssembly>
  <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
  <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0"/>
</dependentAssembly>
Medulla answered 23/4, 2014 at 19:21 Comment(1)
This is did not work. Still ignores the bindingRedirect and the Fusion log is the sameHerder
A
0

Don't forget to include XML namespace in assemblyBinding element.

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Assonance answered 13/5, 2014 at 4:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.