This project is read-only.

Can't add reference to Dotspatial.Controls.dll

Dec 8, 2010 at 2:37 PM

Hi, I'm trying to follow the "developers corner" pdf guide to making a simple winforms app with a mapping control.

When I add a reference to Dotspatial.Controls.dll everything is fine and seems normal, until I build it, then mysteriously it can't find any reference to the dll anymore, comes up with error:

Error    2    The type or namespace name 'DotSpatial' could not be found (are you missing a using directive or an assembly reference?)

The Dotspatial.Controls reference is still listed in the references though, which is odd. I've never seen this happening before, and error does not occur with DotSpatial.Topology for example.

I've tried releases 11-21-2010 and 11-28-2001 (I assume 2001 was meant to be 2010?) both have same issue. Using visual studio 2010 .NET 4 winforms application.

 

Thanks

Martin

Dec 8, 2010 at 4:12 PM

The most unintuitive thing that I will be looking at fixing soon is that something like the Map control requires not only a reference to DotSpatial.Controls to use, but also a reference to DotSpatial.Symbology.   In order to ease your burden, it might be easier to add a reference to all the DotSpatial libraries first.  Then after you have your system set up the way you want it, you can start removing the libraries you don't use.  C# usually is polite enough to tell you that the map requires a reference to DotSpatial.Symbology.  I think Visual Basic just mysteriously treats what should be an editable variable like "map1" as though the variable is not even there.  Extremely confusing if you ask me.  That behavior happens when the required dll is present, but simply a using expression is not in your project.  But in your case it might be claiming that DotSpatial.Controls can't be found because a dependent library is missing?  I haven't seen your exact situation before, so I'm not positive that that is the problem, but I would start by adding a reference to every dll with a DotSpatial in front of it first so that all the libraries are copied to your local directory.

Ted

 

Dec 8, 2010 at 4:53 PM

I tried adding references to all the dlls that are in the main directory (including Symbology), still get same problem. I don't think I've done anything unusual so am puzzled about what's going on.

I imagine its probably something simple and visual studio is just being unhelpful about it.

Dec 8, 2010 at 5:03 PM

Actually just found out the problem, as i guessed it was something simple and vs was being a pain about it.

By default new projects target the .NET 4 client profile, dotspatial needs full .net 4. (vs thinks this detail is only worthy of a warning!!)

I can get it working now, but any chance you could target client profile in future releases, makes it much easier to distribute software.

 

thanks a lot.

Martin

Dec 8, 2010 at 5:05 PM

Might want to check to see that your Target framework in Project Properties is set to .NET Framework 4 and not the Client Profile flavor which is the default.

Kyle

From: Martin5000 [mailto:notifications@codeplex.com]
Sent: Wednesday, December 08, 2010 10:54 AM
To: kellison@geocue.com
Subject: Re: Can't add reference to Dotspatial.Controls.dll [DotSpatial:237588]

From: Martin5000

I tried adding references to all the dlls that are in the main directory (including Symbology), still get same problem. I don't think I've done anything unusual so am puzzled about what's going on.

I imagine its probably something simple and visual studio is just being unhelpful about it.

Read the full discussion online.

To add a post to this discussion, reply to this email (DotSpatial@discussions.codeplex.com@discussions.codeplex.com)

To start a new discussion for this project, email DotSpatial@discussions.codeplex.com@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Dec 8, 2010 at 5:38 PM

One thing I want to look at is pulling out "Design" libraries.  I have never done this before, and as a result we are currently requiring the full 4.0.  If, however, we pull out the design libraries as is demonstrated by the Positioning.Design library, then only those Design libraries depend on 4.0 full.  The rest of the libraries would benefit from the design content through back door loading magic but without having a direct reference to it.  I think if we do that, you could target your own project to be client profile and even ship it without the design libraries at all as they are only needed while you are meddling with the control in the SDK, and the final profile can be client profile.

I think the biggest limiting factor is that Brian is still using a property grid in the Layout control.  This, along with some designer attributes account for most of the content that is forcing 4.0 full right now.  The attributes are easy to switch to a Design library.  I suspect that the property grid might have to be replaced with non-property grid dialogs before the LayoutControl would survive the transition.

Ted

Dec 8, 2010 at 5:40 PM

Check that, not the attributes, but rather the TypeEditors and TypeConverters.  Anyway, those can go to the Design library.

Feb 25, 2011 at 11:43 AM

This do the trick!!! Thank you.

kellison wrote:

Might want to check to see that your Target framework in Project Properties is set to .NET Framework 4 and not the Client Profile flavor which is the default.

Kyle