Friday, September 19, 2008

Error referencing web service

When trying a add a web reference...even to a web service project within your solution, you get this message:

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not create type 'WebService'.

Source Error: 

Line 1:   

Source File: /AJAXEnabledWebSite7/WebService.asmx    Line: 1  

I've had it before and it just stumped me again...

the answer is, that when you change the namespace of your web service, in Visual Studio 2005, the reference in the asmx code file doesn't change. You have to do it manually.

Right click on the file, choose "View Markup" and edit the Class to match the fully qualified, namespace.classname using the newly changed namespace.