5

Is <bindingRedirect /> supported outside of the full .NET Framework? For instance, the following is supported with a normal .NET app (in app.config or web.config):

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="PostSharp"  publicKeyToken="b13fd38b8f9c99d7" culture="neutral" />
        <bindingRedirect oldVersion="3.0.0.0-3.1.1.1" newVersion="3.1.1.1"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

If it is not supported, how is the problem of indirect assembly references addressed? That is, if component A refers to components B and C, and B refers to D v1.0, C to D v1.1, how do we ensure that B finds its dependency if we ship only D v1.1?

Gael Fraiteur
  • 6,759
  • 2
  • 24
  • 31

1 Answers1

5

No binding redirects are not supported in Silverlight, Windows Phone or Windows Store apps. However, this is because they are not needed.

Assuming we are only talking about non-platform assemblies here, basically all three of those platforms have similar binding policies in that they will allow a later version of an assembly to satisfy an earlier version with the same name.

In your particular example, this would mean that component B would automatically get version D v1.1.

David Kean
  • 5,722
  • 26
  • 26
  • And what about platform assemblies? How can I redirect FSharp.Core 4.3.0.0 to FSharp.Core 4.3.1.0 in a WinStore or WinPhone app? – Gustavo Guerra Oct 03 '13 at 16:20
  • Same question about FSharp.Core. Nuget package built in F# requires reference to FSharp.Core 4.3.1.0, however, the largest you can install to the WP81 app is 3.259.4.0 and thus AssemblyLoadException – Alex Sorokoletov Oct 13 '16 at 20:39