Skip to content

With VS2010 Debugger, Step Into, From a Windows .Net App Directly into a Windows Azure Web Role Hosting a WCF Service In The Developer Fabric

Updated: at 02:12 PM

 

OK, I think this is the longest post title I’ve ever made, but if you understand it, you’ll know why it needs to be so long.  I discovered this totally by accident.  I would never ever have pressed F11 (step into) from a client side proxy and expect to get into anything but a bunch of ugly machine generated proxy code (especially with Azure).  To my total surprise, I landed right inside my WCF service as if I had started the Windows Azure Developer fabric in debug mode and set a break point.

So, I’ll step through the process an show screen shots on the outside chance I was dreaming and can’t reproduce it. If I can, now I will have proof so I can do it again.  Sorry for the work in progress code you will see.  The point here is really the debugger and not the code I’m showing so try and ignore that.

OK, here we go.

Let’s assume you have a completely configured azure web role that is hosting a simple WCF service.  When you start that web role and point at the service, you’ll get something like this: (just a note that I started the app fabric by deploying directly from Microsoft Visual Studio 2010 with the start/run.  I am using a debug profile but am NOT running in debug mode.  If I do run the app fabric in debug mode, this does not work.

 

image

 

OK, now let’s run my app that has a WCF client configured to connect to this service.  The configuration is the normal “Add Service Reference” you would expect but I’m showing it any how just to be clear.

 

image

 

Next, we simply Launch Visual Studio 2010 in debug mode and put a break point just before we cross over into the WCF service by calling the above proxy code.  Here is what that screen looks like after the break point is hit and I’m about to step INTO.

 

image

F11

 

and…..

image

There we are!!! right inside the source code that is my WCF service with everything working as if I had launched the site on it’s own, set a break point and waited.

 

Truly amazing!!!  I have nothing more to say.

Check out the ORM (Object Relational Mapper) PRISMA. The database access method I use in all my projects