Reputation: 22954
I have a set of multiple assemblies (one assembly is to be used as an API and it depends on other assemblies). I would like to merge all assemblies into one single assembly but prevent all assemblies except the API one to be visible from the outside.
I will then obfuscate this assembly with Xenocode. From what I have seen, it is impossible to internalize assembly with Xenocode.
I have seen ILMerge from Microsoft, but was unable to figure if it can do what I want. http://research.microsoft.com/~mbarnett/ILMerge.aspx
Upvotes: 1
Views: 1404
Reputation: 2389
I have used ILMerge from microsoft to internalize DLL's into a single assembled library. There is a useful GUI for using ILMerge called NuGenUnify. You can find it here.
Upvotes: 2
Reputation: 155832
There are some issues with ILMerge, but I think if you add optimisations + merge + obfuscation you're likely to create a highly complex situation for little benefit.
Why not have just one assembly, and make only your API public?
If you're always distributing them as a single assembly there's no reason not to just compile them as that. You'll get more benefit from compiler optimisations and it will be quicker to compile too.
Upvotes: 1
Reputation: 5225
I suggest you look at the InternalsVisibleTo
attribute on MSDN.
You can mark everything in all the assemblies (except the API assembly) as internal
instead of public
, then reshow them to just your API assembly.
Having done that, using ILMerge should give you a single assembly with just the API classes visible.
Upvotes: 1
Reputation: 22954
I know Xenocode can merge assemblies into one but I am not sure if it will internalize other non-primary assemblies.
I have found the /internalize switch in ILMerge that "internalize" all assemblies except the primary one. Pretty useful!
Upvotes: 1