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

Topics: General Topics
May 21, 2013 at 11:29 PM
Hi,
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:

Image


Thank you
Editor
May 22, 2013 at 6: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)
Editor
May 22, 2013 at 8:56 AM
I had to change my app.config file to this:

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

I think this fixes it