This project has moved. For the latest updates, please go here.

Problem with WPF / Frameworks (TypeLoadException)

Jan 19, 2011 at 11:01 AM


I have some problem with creating a map in WPF project.

I want to create a map in WPF project, like this:

In Xaml file I write:




<shp:MapControl x:Name="myControl" .../>     


In Xaml.cs file I am extracting the Map object from the MapControl:

using SharpMap;


Map _myMap = myControl.Map;


When setting the .Net framework to be 3.5 or 4 the "<shp:MapControl x:Name="myControl" .../>" line throws TypeLoadException- could not load type 'SharpMap.View'.

When setting the .Net framework to be "4 client profile" the "<shp:MapControl x:Name="myControl" .../>" line is OK but the the VS gets an error in line "using SharpMap" and in line "Map _myMap = myControl.Map"- the erro is "Type or namespace name 'SharpMap' cound not be found...".

The problem is that the program need two different .Net frameworks in order to work correctly.

How to fiix it?

How to show map in WPF project correctly?



Jan 19, 2011 at 11:29 AM

Hello Igor,

the SharpMapSilverlight branch is being developed at, if that is what you're after?

Hth FObermaier