TypeLoadException in mscorlib when targeting .NET 4.0 from NuGet packages v1.5.1

Sep 24, 2013 at 1:12 PM
I am developing a custom application using the Dotspatial NuGet packages (last version 1.5.1). I am developing on Windows 7 in Visual Studio 2012 and have .NET 4.5 available – so didn't notice this problem immediately. The solution targets .NET 4.0 to also run on Windows XP. On Windows XP the application throws the TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' in mscorlib as described here:
http://dotspatial.codeplex.com/discussions/446351
and
http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx
among other places.

Could the NuGet packages be fixed for .NET 4.0 targets? Anything else I can do to fix this? I'd rather not have to drop the packages and use the source, or drop Windows XP support.
Sep 24, 2013 at 7:41 PM
I have been looking into this issue. I know the dotSpatial Source comes with ILMerge but I am not sure where it is being used.