Search code examples
.netassembly-resolution

Is it possible to create a binding redirect at runtime?


Once an application has started is there a way to create a binding redirect that will apply to all future assembly loads?


Solution

  • It could be possible using ICLRHostBindingPolicyManager::ModifyApplicationPolicy, but I've never tried myself. Note that this is a CLR-level interface, so you can't load policies for individual AppDomains (which is why it is not used by PostSharp yet).

    http://msdn.microsoft.com/en-us/library/ms164378.aspx