• info@happli.be

Category ArchiveVisual Studio

Visual Studio – Web Applications : Always debug in Chrome with developer tools open

If, like me, you’re getting bored( it’s just a press on F12 but anyway) of manually having to open the Chrome Developer Tools when you start a new debugging session for a Web Application from Visual Studio, the following trick might help.

We’ll simply tell Visual Studio to pass a specific argument to Google Chrome when it starts it for debugging. That argument is –auto-open-devtools-for-tabs (credits: http://stackoverflow.com/questions/12212504/automatically-open-chrome-developer-tools-when-new-tab-new-window-is-opened)

To let Visual Studio know about that, expand the list of browsers that can be used for debugging and click on “Browse With”, as shown below. In the pop-up that should open, click on “Add”.

List of browsers that Visual Studio can use for debugging

List of browsers that VS can use for debugging

In that pop-up, specify the path to Chrome’s executable file and the argument that VS must pass to it.

Add new browser for debugging

Add a new browser for debugging

You should then confirm and end-up with such a list of browsers. You can set the new browser as the default one (the one that will be used by default when starting to debug your web app).

Add a new brower

This is how it should look now

Then test it. If Chrome was already running, close all its instances (processes included) then start debugging.

Such a trick was used by Scott Hanselmann in the following post http://www.hanselman.com/blog/VisualStudioWebDevelopmentTipAddChromeIncognitoModeAsABrowser.aspx