3

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.)

kizzx2
  • 18,775
  • 14
  • 76
  • 83
  • 1
    Not sure I follow, /internalize is there to ensure the user is *not* doomed. He can't see TypeFoo, it is internal. – Hans Passant Jan 28 '11 at 16:42
  • @Hans Passant: That's what I thought, but I cooked up a simple experiment to prove it. It turns out that even if the user cannot see `TypeFoo`, it is _actually_ there and will cause an eventual namespace collision error during compilation. – kizzx2 Jan 28 '11 at 17:50

1 Answers1

1

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

Jason Crease
  • 1,896
  • 17
  • 17