Vishful thinking…

Debugging embedded JavaScript files in Visual Studio

Posted in Uncategorized by viswaug on March 25, 2008

The credit for this post goes to Rachel who recently informed me how to debug and step through embedded JavaScript files in Visual Studio when using IE. Before today, whenever I had to debug through embedded JavaScript files I resorted to using FireFox even though the application I was building needed to be delivered on IE. What is an embedded JavaScript file? These are the JavaScript files that are embedded inside assemblies and retrieved by the web server using the WebResource.axd handler. Anyway, I have been using them extensively when developing custom tasks (ASP.NET server controls) for the ArcGIS Server .NET ADF. This way all the dependencies for the server controls are contained right within the server control assembly and now the server control can be easily redistributed and used by clients by a simple drag and drop.

The Solution, a “hidden” feature in Visual Studio called the “Script Explorer”.

In visual studio, right click anywhere and toolbar, Customize > Commands Tab > Debug Category > Drag and drop Script Explorer. It is greyed out unless you are in debug mode. In IE, open options, make sure you’ve enabled script debugging. Start debugging your web application, while running, click on script explorer window.  you’ll see all the URL’s to the embedded resources, double click them to bring them up in VS window. You should see the embedded JS code, set breakpoints, mouse over as desired.


2 Responses

Subscribe to comments with RSS.

  1. Jithen Singh said, on March 25, 2008 at 5:53 am

    Yup, this is even easier in Visual Studio 2008 🙂

  2. Cristian remy said, on June 30, 2008 at 7:07 pm

    Thanks! VS is full from hidden treasures

Leave a Reply

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

You are commenting using your 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 )

Connecting to %s

%d bloggers like this: