More JavaScript Debugging in Visual Studio 2008

Well I confess that I perhaps underestimated just how good a feature the JavaScript debugging in Visual Studio 2008 is. I've been building a Vista Sidebar gadget over the last couple of days and was surprised (and impressed) with the support I got from VS.

image

I created an empty solution in VS and could easily add my gadget as a website. That gave me quick and easy access to all my source files (*.xml, *.html, *.js and *.css) which was a good start. But I nearly fell off my chair when I attached the VS debugger to my Sidebar gadget and found I had full JavaScript debugging support allowing me to set breakpoints, single step and inspect variables. That was a huge productivity gain saving me hours of wasted effort (and hair).

Then I saw this post from Kirk Allen (Debug JavaScript in JSP or PHP Pages with Visual Studio 2008) where he attaches to a random PHP page on the internet and proceeds to set a breakpoint in the JavaScript and hit it. This shouldn't really be a surprise - the debugger is attaching to client-side code after all whether it's an HTML page, ASP.NET or PHP etc - but I'd just never tried it. The big surprise is how easy it is to do this sort of thing in Visual Studio 2008.

For my gadget I also found Tim Heuer's Visual Studio gadget template a great starting point.

Technorati Tags: javascript , debugging , gadget , sidebar , vista