Web reference namespace not found 
Author Message
 Web reference namespace not found

James, you don't have to add a using statment for your webservice.  As long
as you have a web reference you are set.
You can reference it in code like this:

net.riche.www.MyClassName var = new net.riche.www.MyClassName();

--
Greg
http://www.*-*-*.com/


Quote:
> I have an assembly that references a web service.  I've added the
reference
> to VS.NET and the default name is "net.riche.www".  In my code, if I enter
> the line:

> using net.riche.www;

> I get the following error:

> ..\bloggermodule.cs(7,7): error CS0246: The type or namespace name 'net'
> could not be found (are you missing a using directive or an assembly
> reference?)

> Am I doing something wrong?  Sometimes it works, but most of the time it
> doesn't.

> Attached is a screenshot showing the error, code, and project tree.

> ----
> James Bailey



Tue, 15 Feb 2005 11:48:15 GMT  
 Web reference namespace not found

Quote:
> net.riche.www.MyClassName var = new net.riche.www.MyClassName();

I have tried that as well and receive the same error.

----
James Bailey



Wed, 16 Feb 2005 00:39:38 GMT  
 Web reference namespace not found
James, try renaming the reference (right click and rename in your project)
to something simpler and unique.

--
Greg
http://www.claritycon.com/


Quote:
> > net.riche.www.MyClassName var = new net.riche.www.MyClassName();

> I have tried that as well and receive the same error.

> ----
> James Bailey



Wed, 16 Feb 2005 00:56:52 GMT  
 Web reference namespace not found
James, don't use a using statement.  That will cause this error.  Just keep
your web reference and then access your web service in code.

--
Greg
http://www.claritycon.com/


Quote:
> > James, try renaming the reference (right click and rename in your
project)
> > to something simpler and unique.

> I renamed it to "riche" from "net.riche.www" and I still get the error.
> (Attached)

> ----
> James Bailey



Wed, 16 Feb 2005 03:54:09 GMT  
 Web reference namespace not found
Okay.  This got really odd.  Renaming the reference back to "net.riche.www",
I get the error.  I looked at the Reference.cs file and found that it set
the namespace to "BloggerModule.net.riche.www".  ("BloggerModule" is the
name of the project.)  If I make the appropriate changes everything works.

Why would it prepend the project name?

----
James Bailey



Wed, 16 Feb 2005 07:02:25 GMT  
 Web reference namespace not found
James, BloggerModule is the name of the namespace too isn't it?  It's trying
to avoid any confusion as to what namespace .net is a part of.  Glad you
figured it out.

--
Greg
http://www.claritycon.com


Quote:
> Okay.  This got really odd.  Renaming the reference back to
"net.riche.www",
> I get the error.  I looked at the Reference.cs file and found that it set
> the namespace to "BloggerModule.net.riche.www".  ("BloggerModule" is the
> name of the project.)  If I make the appropriate changes everything works.

> Why would it prepend the project name?

> ----
> James Bailey



Wed, 16 Feb 2005 12:07:36 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Web Service Not Working -- Namespace not found

2. Web reference not defining namespace?

3. can't find namespace using System.Web.UI.Design

4. System.Web.Mail namespace does not exist???

5. Namespace reference not working...

6. namespace not found

7. namespace name can not be found

8. ???? System.Net namespace not found?

9. Namespace Conflict - c# Class Library used by Web Service and ASP.NET Web App

10. Add Web Reference dialog not working as advertised

11. Adding Web Controls to the System.Web.UI.WebControls namespace

12. Web reference vs local reference

 

 
Powered by phpBB® Forum Software