How to write an asmx web service without using app_code directory?

Posted by JL on Stack Overflow See other posts from Stack Overflow or by JL
Published on 2010-06-01T11:01:32Z Indexed on 2010/06/01 11:23 UTC
Read the original article Hit count: 578

Filed under:
|
|

Excuse the title, but it's best I just explain the problem.

I have 2 projects in my solution

  1. A Class Library
  2. A Web Application, which consists of a web service (asmx).

the web service has code sitting in the app_code folder, with a file [webservicename].cs

Inside the webservice code behind class, I have a web method here is a sample example (its simplified):

[WebMethod]
public EnumTaskExportState ProcessTask()
{
    var tm = new UploadTaskManager();
    return tm.ProcessTask();
}

Now at design time, in visual studio (2010 or 2008), when I right click on UploadTaskMananger, and then select "Go to definition". I get taken to AppData\Temp[some folder structure]...etc.... and it displays the public class definition.

Instead I would like to have complete integration, so that I get taken directly to the actual class in the class library project.

My guess is, this is happening because I am using the app_code route, and not a compiled file for the web service class. But I don't know any other way to do this.

How can I fix this? Possibly do away with the need for the app_code directory?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about webservice