views:

35

answers:

2

I've been trying to use ILMerge to merge assemblies in VS2010 and the resulting primary assembly ends up being unusable. This only seems to occur when the assemblies being merged contain methods with Lambda expressions. Also, it seems to work fine in VS2008. I've outlined my investigation in more detail at http://tinyurl.com/38mz4ef

Any insight into how to solve this would be greatly appreciated.

+1  A: 

There have been recent updates to ILMerge to fix several VS2010 compatibility problems. And there's a new command line option to target .NET 4.0. Download the latest and greatest.

Hans Passant
Can you provide a link to the problems they had to fix for VS2010?
JaredPar
@Jared, I don't. You could ping Mike Barnett at MSFT.
Hans Passant
A: 

Mike Barnett responded via email and informed me the problem might be in my config file somewhere. His suggestion was to use the /targetplatform option:

Ex.

ILMerge.exe /targetplatform:v4,c:\Windows\Microsoft.NET\Framework\v4.0.30319 /out:foo.exe Program.exe MathLib.dll

I added the /targetplatform and path, removed the ILMerge config file and now everything works fine.

John B