0

I have an ASP.NET C# project consuming webservices and WebMethods are wrote in VB.NET with source code on a local IIS server. The WebMethod returns null, and I want to debug it to know why I get this.

As you may know, if I set a breakpoint just before the webmethod call, I cant step into this webmethod.

So, how is the correct way to debug this webmethod?

Thank you!

1
  • What version of visual studio are you using? Commented Jan 21, 2011 at 15:20

2 Answers 2

1

Attach the debugger to the server process, put a breakpoint in the web method code and invoke the web method.

Visual Studio should break within the web method.


There is a bug against VS 2005 for this exact bug - see here.

The solution in the KB article is to change the signature of any String parameters of the web method from byref to byval.

Sign up to request clarification or add additional context in comments.

2 Comments

Ok, I loaded the VB.NET code into VS 2008, I tried to attach the process to WebDev.WebServer.exe, put a breakpoint in the webmethod, but no stop... There's a warning on breakpoint : "The breakpoint will not currently be hit, no symbols have been loaded for this document.".
@elbaid - The web method (and associated code) should already be in the process memory, so call the web method (or another method on the same site) before attaching.
0

The web method runs in a different process (the web service) than the consuming application. Hence, when you debug the consuming application, you cannot step into the web service. You can, however, debug the web service (e.g. by attaching to the appropriate IIS process) while running the consuming application. Another option is to call the web service directly - for simple methods, you can use the test form provided by the web service itself; for more complex things, something like SoapUI is useful to trigger web service calls.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.