Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Imports Namespace cannot be found

Status
Not open for further replies.

dpdoug

Programmer
Nov 27, 2002
455
US
I have a class file named HttpBaseClass.vb where I define a Namespace:

Code:
Namespace BaseClassNameSpace.Web.BaseServices
....
End Namespace

and I want to Import it to a different class file, HttpRequestResponse.vb, wouldn't I declare it like this?:

Code:
Imports System
Imports System.Collections.Specialized
Imports System.Net
Imports System.Text
Imports System.IO
Imports BaseClassNameSpace.Web.BaseServices

when I try to compile my project I get the following error:

Code:
C:\myprojectfolder\Classes\HttpRequestResponse.vb(7): Namespace or type 'BaseServices' for the Imports 'BaseClassNameSpace.Web.BaseServices' cannot be found.

It seems like there is a pretty basic error here but I can't seem to see it.
 
If the definition of the namespace is in another assembly, you'll need to add a reference to it first -- right-click on References in your solution explorer and click "Add", then browse to it. VS.NET will make a copy in your bin directory that you can then use.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
OK. I did that, and it resolved that problem. But I've got a line in the HttpRequestResponse.vb file:

Code:
Dim BaseHttp As HttpBaseClass = New HttpBaseClass(UserPwd, ProxyServer, ProxyPort, Request)

and there is a squiggly line under 'HttpBaseClass'. The error is 'Type expected.'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top