This project has moved and is read-only. For the latest updates, please go here.

Beginner : compiling issues

Topics: SharpMap v0.9 / v1.x
Dec 16, 2011 at 9:42 PM
Edited Dec 16, 2011 at 9:43 PM


I donwloaded Sharpmap 94799.

I tried to compile many SharpMap.VS2008.sln found in different directories.

All of them produced issues (namespaces not found...) : is there assembly references to include to compile successfully ?

Is there a document/tutorial to do it please ?

Thanks a lot for your help,



PS : I found no information in discussions before placing this message.

Dec 18, 2011 at 4:34 PM

You should use the VS2010 solution. The Vs2008 solution in deprecated and is to be removed (and therefore not maintained)

Dec 18, 2011 at 7:54 PM

Thank you for your answer,

I'm going to try with Visual 2010.


Dec 20, 2011 at 8:37 AM

I used Visual 2010.

In last release I downloaded, there are 4 directories :


Please, which directory I have to use to compile ?

I used 0.9 few years ago, but now there is 0.9, 0.9.5, 1.0, 1.1...
What differences are there between all those releases ? I found information between 0.9 and 2.0, but not all thoses versions.

Thank you for your help.



Dec 20, 2011 at 9:13 AM
Edited Dec 20, 2011 at 10:06 AM

Use Trunk. In addition, I suggest you read this

cheers FObermaier

Dec 20, 2011 at 4:57 PM

I used trunk, and it compiled well.

I use 0.9, please how to begin ? which dll I have to reference ? How to create a map on a form ? Where I have to look to find answers to those questions please ?

I found a tutorial intoducing a method using a picture object on a form... This tutorial is not completed.
Is there a better tutorial ?

Thank you,


Dec 20, 2011 at 7:03 PM


I finally placed a picture control I modified in SharpMap.Forms.MapImage.

When I compile, there is an error saying SharpMap namespace is not present. But I included all those dll files in my project :


If I include again those files, SharpMap is offered in my code as I type in... But it disappears since I compile again...
I don't understand...

I use 0.9 release.

I tried using only those files :

But it is still the same.

Have you any idea please ?


Thank you,


Dec 20, 2011 at 7:29 PM
FObermaier wrote:

Use Trunk. In addition, I suggest you read this

cheers FObermaier

Thank you

Dec 20, 2011 at 10:05 PM

You need to set Target Framwork to .NET 4.0 (Full, and not Client) since SharpMap requires that.

Dec 20, 2011 at 10:22 PM

thank you !

It compiles now sucessfully.

I keep on coding...


Dec 21, 2011 at 2:36 PM

I met a new problem : I use SharpMap to display a map in ecw format.

Size files of 903Ko, 3.47Mo, 38Mo are displayed, but one file of 143 Mo makes an error.

Is there a max size ? How to display such a file please ?


Dec 21, 2011 at 9:34 PM

It works from Visual 2010 Debug IDE, but not from the exe file. I saw a post about the same pb. I'm going to have a look.

When I use exe file to run the program, it makes an exception. Here is the text :


Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.

************** Texte de l'exception **************
System.TypeInitializationException: Une exception a été levée par l'initialiseur de type pour 'SharpMap.Layers.GdalRasterLayer'. ---> System.TypeInitializationException: Une exception a été levée par l'initialiseur de type pour 'SharpMap.Extensions.Data.FwToolsHelper'. ---> SharpMap.Extensions.Data.FwToolsHelper+FwToolsPathException: '' is an Invalid Path to FWTools2.4.7. Create an application setting in [app|web].config key='FWToolsBinPath' pointing to the bin directory of FWTools2.4.7 (absolute file path) . FWTools is downloaded from
   à SharpMap.Extensions.Data.FwToolsHelper..cctor()
   --- Fin de la trace de la pile d'exception interne ---
   à SharpMap.Extensions.Data.FwToolsHelper.Configure()
   à SharpMap.Layers.GdalRasterLayer..cctor()
   --- Fin de la trace de la pile d'exception interne ---
   à SharpMap.Layers.GdalRasterLayer..ctor(String strLayerName, String imageFilename)
   à SMap.Form1.button1_Click(Object sender, EventArgs e) dans D:\Temp\TestCMap\SMap\SMap\Form1.cs:ligne 27
   à System.Windows.Forms.Control.OnClick(EventArgs e)
   à System.Windows.Forms.Button.OnClick(EventArgs e)
   à System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   à System.Windows.Forms.Control.WndProc(Message& m)
   à System.Windows.Forms.ButtonBase.WndProc(Message& m)
   à System.Windows.Forms.Button.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Assemblys chargés **************
    Version de l'assembly :
    Version Win32 : 4.0.30319.488 (RTMLDR.030319-4800)
    CodeBase : file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    Version de l'assembly :
    Version Win32 :
    CodeBase : file:///D:/Temp/TestCMap/SMap/SMap/bin/Debug/SMap.exe
    Version de l'assembly :
    Version Win32 : 4.0.30319.454 built by: RTMLDR
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    Version de l'assembly :
    Version Win32 : 4.0.30319.1 built by: RTMRel
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    Version de l'assembly :
    Version Win32 : 4.0.30319.463 built by: RTMLDR
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    Version de l'assembly :
    Version Win32 : 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    Version de l'assembly :
    Version Win32 : 4.0.30319.450 built by: RTMLDR
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    Version de l'assembly : 0.9.4370.37709
    Version Win32 :
    CodeBase : file:///D:/Temp/TestCMap/SMap/SMap/bin/Debug/SharpMap.UI.DLL
    Version de l'assembly : 0.9.4370.37706
    Version Win32 :
    CodeBase : file:///D:/Temp/TestCMap/SMap/SMap/bin/Debug/SharpMap.DLL
    Version de l'assembly : 0.9.4370.37721
    Version Win32 :
    CodeBase : file:///D:/Temp/TestCMap/SMap/SMap/bin/Debug/SharpMap.Extensions.DLL
    Version de l'assembly :
    Version Win32 : 4.0.30319.454 (RTMLDR.030319-4500)
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/mscorlib.resources.dll
    Version de l'assembly :
    Version Win32 : 4.0.30319.454 built by: RTMLDR
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll

************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section
L'application doit également être compilée avec le débogage

Par exemple :

    < jitDebugging="true" />

Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.