Cannot access in-house class library

EdAlaska

Member
Joined
Aug 11, 2004
Messages
9
Programming Experience
10+
I created a class library (dll) that contains to classes. Each class has numerous public methods and properties. I compiled (built) the library and it reported no errors.

I then created a windows app to test the classes within the library (separate solution altogether - not within the same solution as the class library). Within the solutions explorer i added a reference to the class library. I first tried an "imports" statement. I entered imports and the intellisense immediately popped up showing all the references. I chose the library I had created. So far, so good.

I commented out the imports statement and within the forms1 class I attempted a declaration of a variable to one of the classes accessing a "new" sub.. I got no intellisense - um. strange; thought I'd get some there.

I then attempted to use the variable and immediately got an error stating the variable was not declared. Ah? I just declared it!

I pulled up the object browser and sure enuf, there, displayed in living color, were all the public methods, properties and variables.

So, what's the deal? Anyone have any idea? According to the books I've referenced, books online, and MSDN, this is a rather simple task and should work.

Ed.
 
If you don't have the Imports statment in, you have to fully qualify the class (NameSpace.ClassName). The purpose of an imports statement is to do away with having to fully qualify things. For instance, if the System.Windows.Forms nameSpace wasn't Imported, you would have to do this: Dim frm as New System.Windows.Forms.Form instead of just this: Dim frm as New Form . Realize that for WinForm projects, the nameSpace 'System.Windows.Forms' is imported in the project's properties (right click the project in the solution explorer; click Imports under Common Properties on the right side of the dialog; you will see the Project Imports on the left side.) The Project Imports is a shortcut to having to use an Import statement in many classes in the same project.
 
Thanx for your reply

Thanx for your reply but I've already tried that. I was on my way home yesterday after playing with this problem all day. I took today off and did some salmon fishing and while I was doing that it hit me. I'm assuming that when I compile, it also registers the DLL. I won't be back in the office until after next week so won't be able to test my theory, but I suspect that this is the problem.

Ed.
 
Back
Top