Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is <bindingRedirect /> supported in Silverlight, Windows Phone, and Metro?

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?

like image 408
Gael Fraiteur Avatar asked Sep 09 '12 07:09

Gael Fraiteur


1 Answers

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.

like image 194
David Kean Avatar answered Nov 02 '22 11:11

David Kean