ILMerge with .NET 4.0.

If you are getting an “Object reference not set to an instance of an object” when running ILMerge from the command line, ensure that you have quotes around the target platform, like so:
/targetplatform:'v4, C:\Windows\Microsoft.NET\Framework\v4.0.30319',


/targetplatform:v4, C:\Windows\Microsoft.NET\Framework\v4.0.30319.

Leave a comment



     /  September 18, 2010

    For me it didn’t do the trick (ilmerge 2.10.0526.0). Then I tried some options, and the following one worked: /targetplatform:v4,C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 (without quotes and without whitespace between v4 and path to framework.

  2. Use double quote mate! Not single quote!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: