Uncategorized

Debugging WebORB from Visual Studio

Its quite easy to debug applications running within the WebORB for .NET container with Visual Studio, however there are a few precautions to observe before its possible.

Some of the things I mention may seem obvious to you, but based on my experience – some of these very obvious details can be some of the pitfalls that prevent many developers from debugging their applications once deployed to WebORB, so now I include them here in my list for the seasoned developers to ignore and the novices to use.

First make sure that your assemblies are compiled with DEBUG information, you don’t have to deploy the PDB files to the WebORB BIN directory. PDB files are the program database files which holds debugging and project state information for your program, but Visual Studio and the .NET runtime can map the debug assembly to the code in Visual Studio if just the PDB files are available in the output directory of the Visual Studio project.

From Visual Studio (I am using 2008, but its the same for 2005) with the code open used to generate the assemblies, you open the “Attach to Process” window found from the “Debug” menu.

Make sure that the checkbox “Show processes in all sessions” is selected.

Find the w3wp.exe (The IIS Worker Process) and attach the debugger to it.

I have for the sake of convenience mapped the following keyboard shortcut for opening this window: CTRL+SHIFT+ALT+F5. That has enabled me to start the debugging process with the following key sequence:

* CTRL+SHIFT+ALT+F5
* “w” or “W”
* RETURN

Now Visual Studio will start the debugging session and map the debugging assembly to the code in Visual Studio.
As the debugging information are loaded you will see your breakpoint indicators be filled out, effectively indicating that debugging information mapping to the current code have been loaded. If your breakpoint indicators remain unfilled circles, it is not working, a likely cause for this is that the deployed assemblies have been compiled without DEBUG information.

Once your assemblies are loaded correctly and your breakpoint indicators are correctly filled, you turn your attention to either your application or the WebORB management console (I recommend the latter as its always a good idea to test each tier isolated).

Once you execute the code which eventually will hit the breakpoints, control will be transferred to Visual Studio and your debugging session should be fully active.

PS. Yes, the code in the second screendumb is a joke 🙂

Advertisements

6 thoughts on “Debugging WebORB from Visual Studio

  1. Thanks for the tip! I was struggling with this issue for a while.

    I tried your steps, and I was able to get debugging working when the .NET assembly was invoked via the weborb console.

    However, when I try to run the same project via Flex Builder or IE, it will not trigger any breakpoints. I know the project works because its returning all the right information.

    I tested this out on the SampleFlexToDoNet project that is included with the weborb installation (the one that returns computer info).

    Any ideas/suggestions?

    Thanks in advance!

  2. Dear Kiran,

    I’m not exactly sure about the setup you are having and I don’t have any silverbullet for you seeing the limited knowledge I have of your system. I can however confirm that I am capable of running a debugging session from within Flex Builder and trigger breakpoints in my .NET code.
    In general things will be more easy if you override the default settings of Flex Builder and debug / run / profile through HTTP than if I do it through the “file” protocol, if anyhow possible I therefore recommend that you set your Flex Builder to go through “localhost” or the equivalent instead of the default locale file setting.

    Cheers,
    Peter

  3. Peter,

    Thanks for the response.

    I am, in fact, running my project though Flex’s HTTP profile and using “localhost”.
    From your feedback, it seems that my setup could be causing this issue. I went through the wizard and created a Web application / ASP.NET / using IIS. Can’t seem to figure out why it wouldn’t work in the same way.

    Regardless, thanks again for the pointer. I’ll keep looking.
    Kiran

  4. Hey,

    I debug dll’s from weborb , but in a slightly different way (Actually natural way) . Add weborb files as http project in Vs and debug it . weborb console (weborbconsole.htm) opens up. when we test methods from management section. it automatically goes into the breakpoint in dll’s and if method succeeds, it comes back to weborb console again

    Regards
    Raju

  5. Hiya, I discovered this blog on Yahoo Blogs and consider this is definitely very helpful and offers superb subject matter. Thanks for this wonderful post, I will probably promote this on Twitter. Have a good day.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s