ILMerge and StackOverflowException

I was working away this afternoon upgrading one of my products to CRM 2011 when I encountered a very odd error message while using ILMerge:

Process is terminated due to StackOverflowException.

This was very odd because I had the ILMerge command running as part of a Post-Build process which had worked correctly all day.  Then it stopped.

The only change that was made to my machine was an update to Apple’s iTunes software.  No idea if that is what caused it but that was all that changed.  And I even tried rebooting, without effect.

Finally, I found the answer here.

This made my Post-Build command look like this:

if $(ConfigurationName) == Release
/targetplatform:v4,"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"

The command-line parameter /targetplatform was what fixed it.

Leave a Reply 4 comments