Search code examples
asp.netvb.netdebuggingwebmethod

How-to debug a VB.NET WebMethod?


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!


Solution

  • 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.