The type or namespace name 'SharpMap' could not be found

Topics: SharpMap Project, SharpMap v0.9 / v1.x, SharpMap v2.0, WinForms Controls
Mar 4, 2011 at 2:04 PM

Hello, I did download the binaries and added the reference to SharpMap.dll and SharpMap.UI.dll for my windows forms project, but at compile time the below error occurrs:

The type or namespace name 'SharpMap'could not b found (are you missing a usingdirective or an assembly reference?)

Developer
Mar 4, 2011 at 4:16 PM

Just make sure any classes referencing SharpMap classes have "using" statements at the top like... ;)

using SharpMap;

using SharpMap.UI;

Mar 4, 2011 at 5:43 PM

That error occurs just in using statement...

Developer
Mar 4, 2011 at 6:07 PM

So, you have a project reference and a using statement but still get that error? 10 bucks says you are still missing the appropriate using statement or project assembly reference. 

Coordinator
Mar 4, 2011 at 6:25 PM

SharpMap relies, for reprojection, on ProjNet. you must add a reference to that as well. Also iirc, a reference to brutile.dll needs to be added as well.

It is advised strongly to compile the sharpmap solution yourself, since the released versions are usually outdated ;-).

Hth FObermaier

Developer
Mar 4, 2011 at 6:33 PM
FObermaier wrote:

SharpMap relies, for reprojection, on ProjNet. you must add a reference to that as well. Also iirc, a reference to brutile.dll needs to be added as well.

It is advised strongly to compile the sharpmap solution yourself, since the released versions are usually outdated ;-).

Hth FObermaier

Here are the SVN links. Check them out, reference them by project in Visual Studio and you should be good to go. If you are running on Mono then definitely compile all of the code yourself...

SharpMap = https://sharpmap.svn.codeplex.com/svn

Brutile  = https://brutile.svn.codeplex.com/svn

ProjNet = https://sharpmapcs.svn.codeplex.com/svn

Mar 4, 2011 at 6:37 PM

Note my initial statements in my source file

 

using SharpMap;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Similaridade
{
    public partial class MapView : Form
    {
        //--> Define the SharpMap object
        SharpMap.Map _sharpMap;

Coordinator
Mar 8, 2011 at 8:34 AM

Have you tried to build the sharpmap solution yourself?

FObermaier

Mar 10, 2011 at 10:33 PM

The problem was in the type of project created by the Visual Studio 2010. 

Thanks

Editor
Jan 12, 2012 at 9:39 AM

i get the same problem. Please help me. My code bellow:

http://www.mediafire.com/download.php?9inmh8h4mlrrlfy

ps: im using vs 2010.

Coordinator
Jan 12, 2012 at 10:42 AM

Do not use Net40 Client Profile, use Net40

Editor
Jan 13, 2012 at 12:54 AM

good job, thanks FObermaier

Feb 1, 2012 at 6:54 PM

Hello evertonfoz,

I am having a similar problem. How did you fix the error, can you explain with more details.

Thanks

Coordinator
Feb 4, 2012 at 8:10 AM

Hello fbn10040,

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)