I used wsdl.exe to build a C# web services proxy. It contains 2 using
statements that cause compile errors in Visual Studio .NET beta 2:
// the following 2 lines cause compile errors
using System.Web.Services;
using System.Web.Services.Protocols;
//
Here is a simple console program that also yields the same compile errors:
using System;
using System.Collections.Generic;
using System.Text;
// the following 2 lines cause compile errors
using System.Web.Services;
using System.Web.Services.Protocols;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
Here are the compile error messages:
Error 1 The type or namespace name 'Services' does not exist in
the namespace 'System.Web' (are you missing an assembly reference?)
C:\Documents and Settings\bkellett\My Documents\Visual Studio
2005\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 6
18 ConsoleApplication1
Error 2 The type or namespace name 'Services' does not exist in
the namespace 'System.Web' (are you missing an assembly reference?)
C:\Documents and Settings\bkellett\My Documents\Visual Studio
2005\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 7
18 ConsoleApplication1
According to doc, these using statements appear to be correct. Can you tell
me what to do?
Here is info on the versions of s/w I am using:
Visual Studio 2005 Version 8.0.50215.44 (beta2.050215-4400)
.NET Framework Version 2.0.50215
Any assistance greatly appreciated!
Hi Bill,
Welcome to ASPNET newsgroup.
From your description, you're consuming a c# websevice in a C# console
client application through the VS.NET 2005 beta IDE. However, you're
encountering "namespace not found...." error when compiling the client
program (with the autogenerated proxy), yes?
From the code snippet you provided, the namespace you imported are correct.
And I think the problem is likely caused by the assembly which contains the
namespace are not referenced in your client project. From MSDN doc, we can
find that
System.Web.Services and all its sub namespaces are all contains in the
System.Web.Services.Dll rather than System.Web.Dll
So please make sure that you've correctly referenced the
System.Web.Services.Dll in your client project.
BTW, since the VS.NET 2005 RTM has been available , we recommend that we no
longer use the beta products and move onto the released version.
Thank you!
Steven Cheng
Microsoft Online Support

Signature
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Bill" <bk@nospam.nospam>
| Subject: Problem with C# Using Statement on Web Services Proxy
[quoted text clipped - 10 lines]
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:30821
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
[quoted text clipped - 50 lines]
|
| Any assistance greatly appreciated!
Bill - 11 Nov 2005 14:22 GMT
Steven, perfect answer, many thanks!
> Hi Bill,
>
[quoted text clipped - 107 lines]
> |
> | Any assistance greatly appreciated!
Steven Cheng[MSFT] - 12 Nov 2005 04:58 GMT
You're welcome Bill,
Regards,
Steven Cheng
Microsoft Online Support

Signature
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Bill" <bk@nospam.nospam>
| References: <eMrYAlS5FHA.1184@TK2MSFTNGP12.phx.gbl>
<rNmLr5Z5FHA.3076@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: Problem with C# Using Statement on Web Services Proxy
| Date: Fri, 11 Nov 2005 09:22:32 -0500
[quoted text clipped - 9 lines]
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:30858
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
[quoted text clipped - 111 lines]
| > |
| > | Any assistance greatly appreciated!