We get an assembly from a third party, e.g. Example.dll
. Recently the supplier introduced some breaking changes, but didn't change the name of the assembly. Can I rename the new assembly to e.g. Example2.dll
and load it dynamically using reflection? It is not strongly named.
Yes, you can rename it, since it's not strongly named, However, that won't change the namespaces the assembly uses, and it will conflict with the other assembly if they are loaded in the same AppDomain.
The only solution I can think of, assuming you want to use both versions at the same time, is to load it in a separate AppDomain and use proxies to make the calls. I'm not going to go into detail on how to do that though, as it can get very complex. My advise, push back to the vendor to get the breaking code corrected, or to give you a renamed assembly.
Here's a reference to get you started: http://msdn.microsoft.com/en-us/library/yk22e11a(v=vs.110).aspx
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