Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming of .Net assemblies

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.

like image 385
Grzenio Avatar asked May 13 '14 16:05

Grzenio


1 Answers

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

like image 90
Nathan A Avatar answered Oct 22 '22 00:10

Nathan A