Displaying Shapefiles in Visual Studio 2013 for Web

Topics: General Topics, SharpMap Project, Web Controls
Aug 20, 2015 at 1:30 PM
Hi Community,
my aim is to display shapefiles in a web application using MS VS 2013 for Web and I am fairly new to this subject.
First i attempted to use the javascript API from ESRI which however does not meet my requirements completely i guess, since it doesn't support adding your own shapfiles with a huge amount of features.
I now tried to work with SharpMap but for any reason I don't get it to work at all. I am able to add SharpMap to my project with Nu Get Manager but seem not be able to use ist. I think I maybe didn't compile correctly? Or the .Net-Framework version isn't compatible? Or does VS 2013 for Web not support SharpMap since you can't create the right forms?
I am dealing with different error messages so I find myself unable to document my problem here detailled.
In the end I am mostly wondering if SharpMap is the best tool for me, or if I should change the VS version or whatever?
Hope to find some kind people here able to help me bloody newbie :)
Aug 21, 2015 at 8:07 AM
To run SharpMap in a web context, you need to install SharpMap.Web package.

Additionally, have a look at How do I use the HttpHandler for an ASP.NET application

There are several Web projects in the repository, that should get you going.
Aug 25, 2015 at 10:31 AM
Thanks! That helped a lot indeed, I got a huge step forward!
But is it necessary to work with .Net-Framework 4.0? I changed to 4.0 from 4.5 (default) but now I'm getting several errors about the Nu Get-Packages and the References - seems a lot of work to me to change them all to 4.0 Framework. Or is there an easy way to do this?
Aug 25, 2015 at 1:48 PM
The problem is that GeoAPI and NetTopologySuite, both assemblies SharpMap relies upon, provide assemblies for .Net Framework 4.5 while SharpMap does not.
SharpMap needs the reference to the .Net Framework 4.0 versions of these libraries.

The solution to your problem is to manually edit the packages.config file(s) (net45 to net40-client) and run update-package -reinstall.