Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling A Webservice

Status
Not open for further replies.

NeilTrain

Programmer
May 27, 2003
275
US
I have a webservice, mapperservice.asmx, which calls the code behind page defined in App_Code\Service.cs

This service is now live, so I would like to have a dev version next to it. So I copied both files, so now I have mapperservice_dev.asmx, and App_Code\Service_dev.cs

But even without building the project, if I try to access mapperservice.asmx, I get an error that the code in Service_dev.cs does not compile.

Why does this happen? I figured they compiled independently since there is no DLL present, and I did not build the project. Why is the project being built without me telling it to? And why cant I seperate my two services?
 
Can you post you code.

Here is a guess
Look at mapperservice_dev.asmx using note pad. You may need to modify the directive to point to Service_dev.cs.

Does Service_Dev.cs define the webservice or is this where the processing is happening. You may need to change class names as well.
 
I think you missed the point.

In regular asp web apps I can change the code in the .cs files, and those changes do not go into effect until I build the site. This is not what's happening in the webservice. As soon as I save a code file, it trys to compile the entire site.

The mapperservice.asmx and mapperservice_dev.asmx point to different code behind files, and different classes. Yet when I change the dev.cs file to something that doesnt compile, and save it (just a save, without trying to build) the mapperservice.aspx service fails, and shows a compilation error pointing to service_dev.cs even though that is not the code behind file for that service.
 
I was using codebehind, so I removed the directives, however the same problem occurs. I have these two headers in my asmx files:

MapperService.asmx:
Code:
<%@WebService Language="C#" Class="MapperService"%>

MapperService_dev.asmx:
Code:
<%@WebService Language="C#" Class="MapperService_dev"%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top