Problem with WPF / Frameworks (TypeLoadException)

Jan 19, 2011 at 12:01 PM

Hi,

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:

...

xmlns:shp="clr-namespace;SilverlightRendering;assembly=WpfRendering"

...

<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?

Thanks,

Igor

Coordinator
Jan 19, 2011 at 12:29 PM

Hello Igor,

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

Hth FObermaier