Can
Can

Reputation: 699

Debugging WebService solution in VS at localhost

I have a WebService solution with Sample.svc and Sample.svc.cs containing a method like;

public override ResponseClass GenerateResponse(RequestClass request)
{
     // Some code here.
}

I want to test and debug code line by line with adding breakpoints, but i do not have any knowledge about how to do it?

How can i debug the webservice code?

Upvotes: 0

Views: 1773

Answers (1)

Mairaj Ahmad
Mairaj Ahmad

Reputation: 14604

You need to do following there may be other ways.

  1. Host the service in IIS.
  2. Now open code of service from VS.
  3. Go to Debug
  4. Click on Attach to process.
  5. Select the process in which service is running.
  6. Put breakpoint at method which you want to debug.
  7. Now call that method from other application it will hit break point.

Upvotes: 2

Related Questions