Example 1: Adding 1 layer to the Map crash during execution

Topics: General Topics
May 21, 2013 at 10:29 PM
I'm trying to do the first example "Example 1: Adding 1 layer to the Map". The compilation is fine, but when I execute it:
 private void InitializeComponent()
     this.mapBox1 = new SharpMap.Forms.MapBox();   <-------at this line
I get this. SharpMapUI, SharpMap are added in my references:


Thank you
May 22, 2013 at 5:39 AM
This has been answered elsewhere in the forum.

I think ts is the solution:

Make sure you're using the correct .NET version

Do not use Net40 Client Profile, use Net40 (you can change it in your project-settings under the Application-tab)
May 22, 2013 at 7:56 AM
I had to change my app.config file to this:

<?xml version="1.0"?>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <assemblyIdentity name="GeoAPI" publicKeyToken="a1a0da7def465678" culture="neutral" />
    <bindingRedirect oldVersion="" newVersion="" />

I think this fixes it