[Posted by George V. Reilly]
I use the timebombed Internet Explorer Virtual PC images from Microsoft to test the Cozi web client under IE6 on Vista. The VPC images come preloaded with the horrible, ancient Script Debugger, which hasn't received any developer love since periwigs were in fashion. Not recommended unless you can't find anything better.
But there is something better: Visual Web Developer 2008 Express Edition. VWD is free and it comes with a great JavaScript debugger and intellisense.
Unfortunately, it's not at all obvious how to actually use VWD to debug JavaScript running in IE. I eventually figured it out, with some help from Jaro, a former colleague of mine in IIS, who managed to find a short video explaining what to do for VWD 2005.
Here, then, are the necessary steps in VWD 2008.
Install Visual Web Developer 2008. You can turn off all the optional extras. If you're doing this inside Virtual PC, use CD > Capture ISO Image....
In Internet Explorer (6 or 7):
-
Tools > Internet Options > Advanced:
-
Clear Disable Script Debugging (Internet Explorer)
-
In Visual Web Developer:
-
Create an empty website project, which defaults to
C:\...\WebSite1\:- File > New Web Site > ASP.NET Web Site
-
Modify Website > Start Options and set the URL to a good starting point in your application:
- Start action: Start URL: http://foo/bar/
- Server: Use Custom Server: http://foo/bar/
- Debuggers: Disable ASP.NET debugger
- File > Save C:\...\WebSite1 to save the website project
Use Debug > Start Debugging (or hit F5) to launch Internet Explorer. Set breakpoints in your code by clicking in the left margin of some source code.
At one point (and I forget the details), I had to uninstall the old Script Debugger, then Repair VWD in Add or Remove Programs.
On Vista, I think it's probably necessary to use Run as Administrator when starting VWD.





Thanks a lot for this note .. it was really helpful
I was stuck with some IE Specific issue and was wondering how to debug script in a JS file
Really appreciate your blog
Ajit
Posted by: Ajith | April 02, 2008 at 04:12 PM
Don't forget to set IE as your default browser, otherwise FF or whatever will be launched, which VWD EE can't attach to.
Posted by: Tiest Vilee | July 23, 2008 at 09:59 AM
Thanks for your little article. It helped me a lot. Especially the hint about uninstalling MS Script Debugger was essential to me.
Posted by: Ralf | September 16, 2008 at 07:41 AM