This project is read-only.

DotSpatial.Controls in VS 2010 c# (and co)

Mar 6, 2011 at 5:53 AM


I tried tutorial 1 in VS 2010:

1. VB,Net ==> works fine
2. C++.Net ==> works fine
3. C#.Net == creates problems (see below):

Error 7 The type or namespace name 'Controls' does not exist in the namespace 'DotSpatial' (are you missing an assembly reference?) C:\MyIrrlicht\DS_tut_1_cs1\DS_tut_1_cs\DS_tut_1_cs\Form1.Designer.cs 40 43 DS_tut_1_cs

This error occurs several times for statements like these:
this.legend1 = new DotSpatial.Controls.Legend();
this.map1 = new DotSpatial.Controls.Map();

I guess that because I am not fluent at all in C#, I must have done something wrong in setting up the project and it's resources.

Please, anyone, give me some instructions for dummies on how to do this.

Cheers, Gerd

Mar 7, 2011 at 6:17 PM

Hi Gerd! I'm glad to see that you got the first tutorial to work in VB.NET. You probably noticed that we've posted those tutorials as Word documents. That was to encourage people to edit and improve them. So, for example, if you wanted to add the code snippets for how to do the tutorial in and/or C# that would be great. Just edit the document and send it to me. I'm actually not sure what went wrong in C#. I'll copy this to Teva who made the tutorial and get his input. - Dan

Mar 8, 2011 at 5:41 AM

Hi Gerd,

In the c# Visual Studio Solution Explorer, right-click on the name of your project and choose "Properties". In Properties go to "Application". Check the Target Framework. You must change the "Target Framework" from ".NET Framework 4 Client Profile" to ".NET Framework 4".

Also, check that your project the references to all required DotSpatial assemblies as described in the tutorial.

Hope this helps,


Mar 8, 2011 at 10:45 PM

Hi Jiri,

thanks for that hint. I must have had another of these "Senior Moments" and overlooked to change the framework.

Now everthing is fine.

Cheers, Gerd