ILMerge: Rename internalized assemblies' namespaces?

1.3k views Asked by At

For example, let's say I want to use Bouncy Castle in my DLL. Since I want to ease deployment, I use ILMerge to combine MyDll.dll and BouncyCastle.Crypto.dll to produce MyDllMerged.dll. I use the /internalize flag in ILMerge so that clients do not use my Bouncy Castle.

If my consumer EndUser.exe also uses Bouncy Castle, he'll see that "Org.BouncyCastle...TypeFoo is already defined in MyDllMerged.dll". Therefore, he is doomed and cannot use his that library himself.

Is there anyway to tell ILMerge to rename all namespace in an assembly, in addition to internalizing it? Or any other ways to solve this problem? (I'd like not to have to distribute the "merged" version and "unmerged" version separately.)

1

There are 1 answers

0
Jason Crease On BEST ANSWER

One way would be to use an obfuscator (SmartAssembly, Dotfuscator, etc) to obfuscate just the Org.BouncyCastle namespace of the produced assembly.