BUG: Compile Error Message When You Add a Web Reference to a Managed Extensions for C++ Application (317807)
The information in this article applies to:
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
This article was previously published under Q317807 SYMPTOMS When you add a Web reference to a .NET Web service (.asmx
file) in a Managed Extensions for C++ application, you may receive a
compile-time error message similar to the following:
Creating web service proxy file... Error: Cannot find definition for
http://test:test. Service Description with namespace http://test is
missing. Parameter name: name If you would like more help, please
type "wsdl /?". error CS2001: Source file 'Server.cs' could not be
found fatal error CS2008: No inputs specified The system cannot find
the file specified.
You do not experience this behavior when you
add the Web reference in a Visual C# .NET application or in a Visual Basic .NET
application. RESOLUTION To work around this issue, you have to generate the client
proxy class (.cs file) that the error message shows as "not found," and then
generate an assembly (.dll file) to which you can reference. To do this, follow
these steps:
- To generate the client proxy class, use the Web Services
Description Language tool (Wsdl.exe). Type the following command at a Visual
Studio .NET command prompt, and then press ENTER. Verify that you are working
in the same directory where the project is located.
wsdl http://localhost/WeblessService/WeblessService.asmx
- The following are two ways to generate an assembly from the
client proxy class that you generated previously:
- Generate an assembly manually by typing the following
command at a Visual Studio .NET command prompt. This command generates the
Server.dll assembly. -or-
- Generate the assembly through the add webreference
wizard. To do this, follow these steps:
- Remove the .wsdl file (for example, Server.wsdl)
from the project's Solution Explorer window. This file was added when you tried
to add the Web reference earlier. If you do not remove the Server.wsdl file
that was created earlier, the wizard will create Server1.wsdl and will look for
Server1.cs proxy, and then you will receive an error message again.
- Try to add a Web reference from the Solution
Explorer. Use the same procedure that you tried earlier. You do not receive an
error message this time because you have already generated the client proxy
class.
- You have to add a reference to use this assembly. To do
this, add a reference to the WebService.h header file (add #include
"WebService.h" statement in the ProjectName.cpp
file) that was generated when you tried to add the Web reference through the
wizard. This header file adds a reference to the Server.dll
assembly.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
REFERENCES
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
310674
HOW TO: Add References to a Managed Visual C++ Project
Modification Type: | Major | Last Reviewed: | 12/6/2003 |
---|
Keywords: | kbbug kbpending KB317807 |
---|
|