Using ILMerge to get one assembly from multiple

Using ILMerge to get one assembly from multiple

JamesMaeding
Advisor Advisor
1,166 Views
4 Replies
Message 1 of 5

Using ILMerge to get one assembly from multiple

JamesMaeding
Advisor
Advisor

My programs typically involve several libraries of functions, and each library is a separate dll.

I want to try making one dll from them, and ILMerge seems to be the tool of choice.

I also found the ILMergeGUI tool, and tried it on one of my programs.

 

It made the combined dll, but said it had an error because it could not find accoremgd.

Of course, that is one from autocad, and copylocal is false so I don't want it wrapped in the combined dll.

 

I was surprised to find only one post in this DG when searching for the ILMerge term.

You can only load one .net dll by a given name into acad, so two programs with the same name .net dll (but in two different folders) is a big problem.

.net is great in that you can keep a prog's needed dlls right next to the exe or main dll, but acad does not see two assemblies by the same name as distinct.

Combining them would get around this.

 

Anyone using ILMerge on .net progs written for acad?

thx


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
1,167 Views
4 Replies
Replies (4)
Message 2 of 5

Keith.Brown
Advisor
Advisor
I am not using ILMerge but I am using .Net Reactor to combine about 10 assemblies into one. I do this for several main assemblies that contain a few common dlls. I have no issues with this. Keep in mind that Autocad will only load an assembly once so for the common assemblies the first program that loads the common assembly will keep it loaded. Not a big deal unless you get your common assemblies out of sync. I.E. Different versions .
Message 3 of 5

JamesMaeding
Advisor
Advisor

slick!

so combining them did get around the common assembly issue?

 

I actually keep all the common libs in synch by recompiling all progs if they change.

The problem is I want to make a prog for just one person to test, and that will put the libs out of synch so here I go 🙂


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 4 of 5

vucic_tamara
Enthusiast
Enthusiast

Hi James,

 

I know it's been a long time since this post, but I am also having two different applications loaded into Civil 3D that have a common .dll base, so if their versions are not synced I have a problem. Did you manage to merge .dll files and solve that problem?

 

Greetings,

Tamara

0 Likes
Message 5 of 5

ntclmain
Advocate
Advocate

@vucic_tamara 
I use ILRepack.Lib.MSBuild.Task by RBSoft instead of ILMerge to combine .dll files into one DLL

and

Resource.Embedder by Marc Stan to embed translations files  into the above combined .DLL file

You can get these packages from Nuget Packages Manager in Visual studio

With these packages installed, the combination process is automatically done when you build a project.