Cannot drag and drop map box control with RC1

Topics: WinForms Controls
Mar 28, 2013 at 7:29 AM
While dragging and dropping MapBox control on windows form, getting this error:


Thanks and regards,
Mar 28, 2013 at 7:33 AM
Hi, you need to add the assemblyredirect of GeoAPI to your config.

You config-file should look something like
<?xml version="1.0"?>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="GeoAPI" publicKeyToken="a1a0da7def465678" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion="" />
Mar 28, 2013 at 9:03 AM
I have added this in my config file app.config (windows form application), but still it is not working.
Mar 28, 2013 at 9:13 AM
  • Does GeoAPI.dll exist in your output directory (with verison 1.7.1)?
  • Does yourapplicationname.exe.config exist in your output directory and include the above configuration?
Mar 28, 2013 at 6:42 PM
I got the same error when drag MapBox or MapImage control on the form!
All libraries are located next to the executable file and app.config fixed

Mar 28, 2013 at 8:57 PM

I can verify that the Visual Studio designer doesn't work for MapBox. The app.config settings doesn't seem to be used in VisualStudio Designer Mode.

You can get around it by adding the assemblyRedirect statement to your visual studio config file (devenv.exe.config) or to your Machine.config file.

However, this is not a good solution.

We will have to discuss how we should handle this for the release of 1.0.
Either we need to make sure that GeoAPI/NTS is not loaded in designer mode or we'll have to force a new release of NTS and that way get around the AssemblyRedirect of GeoAPI.
Mar 28, 2013 at 9:00 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Apr 4, 2013 at 4:55 PM
The fix for this issue is included in SharpMap 1.0 RC2 just released under downloads section.

Best Regards,