ILMerge: rename interpolated node namespaces?

For example, let's say I want to use Bouncy Castle in my DLL. Since I want to facilitate deployment, I use ILMerge to combine MyDll.dll and BouncyCastle.Crypto.dll to create 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 will see that " Org.BouncyCastle...TypeFoo already defined in MyDllMerged.dll ". Therefore, it is doomed and cannot use its own library.

Is there anyway to tell ILMerge to rename the entire namespace in the assembly, in addition to internalization? Or any other solutions to this problem? (I would not want to distribute the "merged" version and the "unrelated" version separately.)

+3
source share
1 answer

One way is to use an obfuscator (SmartAssembly, Dotfuscator, etc.) to confuse just the namespace Org.BouncyCastle of the created assembly.

+1
source

Source: https://habr.com/ru/post/887092/


All Articles