Problem with C# Using Statement on Web Services Proxy

B

Bill

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!
 
S

Steven Cheng[MSFT]

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

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "Bill" <[email protected]>
| Subject: Problem with C# Using Statement on Web Services Proxy
| Date: Wed, 9 Nov 2005 07:29:42 -0500
| Lines: 56
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| NNTP-Posting-Host: cpe-24-164-176-193.hvc.res.rr.com 24.164.176.193
| 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
|
| 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!
|
|
|
|
|
 
B

Bill

Steven, perfect answer, many thanks!

Steven Cheng said:
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

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "Bill" <[email protected]>
| Subject: Problem with C# Using Statement on Web Services Proxy
| Date: Wed, 9 Nov 2005 07:29:42 -0500
| Lines: 56
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| NNTP-Posting-Host: cpe-24-164-176-193.hvc.res.rr.com 24.164.176.193
| 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
|
| 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!
|
|
|
|
|
 
S

Steven Cheng[MSFT]

You're welcome Bill,

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Bill" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Problem with C# Using Statement on Web Services Proxy
| Date: Fri, 11 Nov 2005 09:22:32 -0500
| Lines: 125
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| NNTP-Posting-Host: tide502.microsoft.com 131.107.0.72
| 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
|
| Steven, perfect answer, many thanks!
|
| | > 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
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| > --------------------
| > | From: "Bill" <[email protected]>
| > | Subject: Problem with C# Using Statement on Web Services Proxy
| > | Date: Wed, 9 Nov 2005 07:29:42 -0500
| > | Lines: 56
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| > | NNTP-Posting-Host: cpe-24-164-176-193.hvc.res.rr.com 24.164.176.193
| > | 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
| > |
| > | 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!
| > |
| > |
| > |
| > |
| > |
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top