Brutile.Desktop.DLL 4.0.3 Issues

Oct 24, 2013 at 12:58 PM
I've an Issue with the BruTile.Desktop DLL. I'm deploying SharpMap using the nuget packages, targeting the 4.0.3 framework. When I deploy to the server, the web site throws an exception trying to access something that is in the 4.5 framework that is not in the 4.0.3 runtime

TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=

If I delete BruTile.Desktop.dll, everything works. I had to find this out through trial and error of about twenty assemblies. Not pleasant.

I notice that there are newer versions, but nuget says they are not compatible with sharpmap. I kind of doubt, but why fight it?

Any help here? Right now, I delete this file before I deploy.

Oct 24, 2013 at 3:08 PM
Not sure what the problem is here. I don't see any assemblies built for .net 4.5 in 0.7.3.

Did you build SharpMap yourself? I see the current version of SharpMap is built for 4.0.

What if you use the SharpMap Nuget package?
Oct 24, 2013 at 11:09 PM
I did not build SharpMap. I'm just using NuGet.

I didn't see an assembly marked for 4.5 either. That was why it was so hard to find.

You can reproduce the problem on a W7 machine with only 4.0.3 installed. The problem is that when you build with VS 2012, you get 4.5. You have to deploy the application to a system without 4.5

It's not a big deal. I uninstalled SharpMap and all associated dependencies, cleaned out the bin folder and the gdal post build junk and just linked in the pieces of SharpMap that I needed. This way the Publish action doesn't copy all the extra junk to the web site and IIS doesn't try to load everything at once.

If you Google System.Runtime.CompilerServices.ExtensionAttribute you see the issue.

This explains it

Good luck.
Oct 25, 2013 at 9:41 AM
Thanks for you clear feedback. We do use ILMerge as mentioned in the stackoverflow post. Perhaps we could fix this by not using ILMerge or use it differently.