views:

324

answers:

3

I have a web service created in a VS2005 asp.net 2.0 framework app that I need to consume in a 1.1 framework app. I built the web service - then built a little 1.1 framework tester app to call it and it worked great. So now I have added the web reference exactly the same way to the main 1.1 framework app that I need to consume it in. The web method being called is of type boolean and returns true if successful. I get back true - but the updates that the web method are supposed to perform are not occuring. When I was calling the web method from the small test app - they occured just fine.

My question is - how can I debug this from my 1.1 consumer into my 2.0 provider? MS docs say I should just be able to set a breakpoint on the call to the web service and step right in (currently in development they are both on the same machine). This does not work as it just steps right over that line of code. Any help appreciated.

+1  A: 

Make sure you have <compilation debug="true"/> in both web.config files, and make sure they are both built in DEBUG mode.

Now that I think of it, that probably won't work. I presume you are debugging the .NET 1.1 code with VS2003, right? It's not going to step into .NET 2.0 code. You're going to have to start a separate VS2005 instance, attach to the process running the web service, set your breakpoints, then wait.

John Saunders
@John Saunders Yes - I am running the 1.1 from VS2003. Tried your suggestion - get "Cannot attach to process" popup error - nothing else.
Jim Evans
You got that message attaching from VS2005 to the .NET 2.0 service? Why did it say it could not attach?
John Saunders
No - I got the message from VS2003 trying to attach to the 2.0 app running the service. I have actually fixed my web service issues and all is working now, but it would still be interesting to discover how to debug from a 1.1 app consuming a 2.0 service.
Jim Evans
Jim, that's my whole point: VS2003 uses .NET 1.1. It will never be able to attach to a .NET 2.0 application. You have to use VS2005 to attach to a .NET 2.0 application.
John Saunders
OK - so I had a small 1.1 test app calling the service and everything worked fine. Whe calling the same service from the main 1.1 app the same way - the updates did not occure? How would I have been able to tell why it worked one way and not the other? (It's fixed now so I would actually have to break it again.)
Jim Evans
BTW - the fix was the pointer to the web service. Have not done web services in over a year and made a rookie mistake - pointed to localmachine instead of machine name.
Jim Evans
You would have seen this if you had looked at the network traffic using Fiddler or some other such tool. You'd have seen the request go to the wrong system.
John Saunders
A: 

In VS 2005 or 2008 you can attach any process to debugger but in VS2003 i don't no, its very arquaiq.

If don't work you can always convert from 1.1 to 2.0 is very cleany because have half functions of 2.0

pho3nix
Are you sure you can attach the VS2008 or VS2005 debugger to a .NET 1.1 process? I don't think so, they're running different versions of the CLR. Similarly, you can't attach VS2003 debugger to a .NET 2.0 process, since the CLR is different.
John Saunders
It's actually the 1.1 that would have to attach to the 2.0 process. Cannot convert the 1.1 app. It's huge ane will be eventually rewritten. As I stated above - the problem is actually solved -now it's just a curiosity about the debugging :)
Jim Evans
A: 

I have never been able to debug a 2.0 web service using VS2003, but what I usually do, is set up two debuggers. One for the 1.1 app in VS2003, and a second debugger attached to IIS that's running the webservice using VS2005 (attach to aspnet_wp.exe in WinXP, or W3WP.exe on WinServer2K3 or Vista). That way, you can debug your 1.1 app, and you can also have a debugger sitting on your Web Service.

Another way to always launch your debugger is to add the following line to your code, and it will pop up a dialog box when called that will give you the correct debugger options:

System.Diagnostics.Debugger.Break();

If you add that into your web service when you want to debug, it'll force you to open a debugger to continue code execution.

Relster