ILMerge hangs on merge
Asked Answered
B

2

41

I am using ILMerge to combine 9 .NET DLL's written in C# .NET 4. The problem is ILMerge gets stuck, no error message or anything.

The log shows that ILMerge merges all the assemblies correctly, then sets out to write the target assembly. It runs the assembly resolver for a bunch of references and then.. nothing. After successfully resolving System.Configuration the log shows nothing else.

The program continues to use the CPU but I don't see if it's doing anything.

Any one else had a similar experience?

Brachyuran answered 29/12, 2011 at 17:54 Comment(0)
B
95

Looks like just writing out the question helped.

Turns out I needed to add /targetplatform:v4 to the command. My guess is it's because some of the assemblies use .NET 4 and some use .NET 2.

Brachyuran answered 29/12, 2011 at 18:6 Comment(3)
I was attempting to merge two v4.6 assemblies and ran into the same problem. I used the recommendation above as-is (:v4) and it worked. Looks like several of our projects have a reference to a 2.0 version of the Microsoft.VisualStudio.QualityTools.UnitTestFramework.Mcclung
You are my hero for todayPatrimony
Ditto. I came across the simpler answer first, but marked this up.Ostracon
F
2

I was experiencing problems with ILMerge hanging, but using IL Repack instead with the same arguments seemed to fix the issue for me.

Fredra answered 23/3, 2015 at 20:32 Comment(1)
Along with specifying the /lib switch to cure that error, your answer fixed my problem.Ostracon

© 2022 - 2024 — McMap. All rights reserved.