You can use BindingRedirect to redirect YourAssembly.dll 1.1.0.0 to 1.2.0.0.
Does anyone know if its possible to do this if the assembly names are different.
E.g.
YourAssembly1.dll (v1.1) redirects to YourAssembly2.dll (v2.8)
This means that if two components reference different versions of the same strong-named assembly, the runtime automatically adds a binding redirection to the newer version of the assembly in the output app configuration (app. config) file.
Disable through project propertiesRight-click the project in Solution Explorer and select Properties. On the Application page, uncheck the Auto-generate binding redirects option. If you don't see the option, you'll need to manually disable the feature in the project file.
My understanding is that "Post-policy reference" is the assembly reference after publisher policies, and in general assembly redirections, have occured.
Open the NuGet Package Manager Console, specify the appropriate Default Project and enter the command Add-BindingRedirect. As if by magic, an app. config is added to the project (if one doesn't exist already) and the appropriate information added. Sweet!
If I recall correctly, I did this about 4 years ago using the AppDomain.AssemblyResolve event. The idea is that you get the AssemblyName request and you return an Assembly. In some cases, I was even able to generate DynamicAssembly at runtime and inject that. I forget what effects strong naming has on this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With