tags:

views:

34

answers:

1

What does ILMerge do?

Does it create a single new assembly, or just put multiple assemblies in to one dll?

I'm asking from the perspective of:

  • What happens when I'm merging assemblies that have InternalsVisibleTo attributes to each other?
  • What happens if I'm doing reflection from strings from fully qualified assembly names

Thanks

+3  A: 

I'm not sure what distinction you're trying to draw between merging assemblies and putting everything into one file. What it does though is take a set of .Net assemblies and produces a single assembly which contains the combined contents of all of the assemblies.

This has no affect on the InternalsVisibleTo attribute for the assemblies being merged. This attribute is used by the runtime to allow access to internal constucts between assemblies (which is otherwise illegal). Since they are all now in one assembly though they are free to access each other's internal types without the use of InternalsVisibleTo. So in short, if the internal access was valid before the merge, it will be valid after the merge.

I'm unsure as to what you mean by the reflection and fully qualified assembly names. But there seem to be two cases I can think of

  1. Grabbing a types assemblie qualified name at runtime. This will still work fine but you will get the merged assembly name instead of the original assembly name
  2. Hard coding assembly qualified names of types into a project. This will cause issues if you use the assembly name before the merge as that type no longer exists.
JaredPar