views:

18

answers:

1

I have a vb.net solution is VS 2010.

I have two projects in this solution, one of which is a class library that we've used for some time. My desire is to reference THAT project from the other one.

I opened the options of project 1, and added a reference to the other class library project, and all seems well. Solution builds just fine.

However, when I try to add an 'Imports' statement in project 1, the referenced project will NOT show up.

I'm convinced this is something obvious, but this is maddening. Any advice?

A: 

Do you have namespaces in your referenced project ? Imports works with namespaces if they are used, not the name of the reference. For exemple, you can reference the PresentationCore DLL, but you would import the System.Windows.Media.Imaging namespace.

Matthieu
Yes, the entire project is wrapped in a namespace, and that namespace doesn't show up in the imports intellisense, nor can I call it by typing it out manually.
Ducain
Is this namespace even listed in the part of the My Project/ references panel named "Imported Namespaces" ?
Matthieu
@Matthieu - good call. It IS listed there, but was unchecked. I don't recall ever having to do that before, but I normally work in C#. That being said, I did check the box for the namespace I need, rebuilt the solution (succeeded), and yet the problem remains. I can't see it in imports on my form, nor can I type it out and use it.
Ducain
Checking it in will just auto-import it in every file you're using, so it doesn't solve your issue, and it`s usually a bad practice (except for must have namespaces) if you want to keep track of your dependencies. But at least the namespace is recovered. Still thinking about possible solutions...
Matthieu