Setting the Default Browser in Visual Studio 2010

by DRohm 21. August 2010 18:09

If you haven’t read Scott Hanselman’s awesome post on how to use PowerShell to set the Default browser for Visual Studio you should.  I went about doing this for my environment, made the external commands and modified the PowerShell script to take the browser name as a parameter.  Everything works great.  At this point I wanted to add icons for my new toolbar when I found out that the VS2010 team, in their transition from a Win32 based UI (shell and command system) to one based solely on WPF, didn’t have time to implement the ability to add icons to commands through the Customize dialog.  They simply didn’t have time before the launch.  But after reading through the comments of that post I found the link to a Visual Studio extension to change command images by Ryan Molden who is on the Visual Studio team (download the extension here).

When you invoke the extension through the ‘Tools…Customize Command Images’ command you’ll get a dialog like this:

CommandingImage

Through this dialog you can add any custom icons and then apply them to your commands.  After creating icons for each browser and adding them with the tool, my new toolbar looks like this:

Toolbar

On a side note, I used IcoFX’s ‘Extract…’ feature to get the icons from each browsers executable.  Scott Hanselman had another great post on how to create custom PowerShell icons for your Visual Studio command prompt.

Now, when I want to run a site I can choose which browser I want.  When I click the IE command button I get:

BrowserChangeToIE

for the Firefox command button:

BrowserChangeToFirefox

and for the Chrome command button:

BrowserChangeToChrome

Hopefully this functionality will get added to Visual Studio in a future service pack.

blog comments powered by Disqus

About Me

Doug Rohm
Twitter Technorati

Doug Rohm
Boston area .NET developer, geek, gamer, dog lover, and sports nut.

Windows Phone 7 Developer Launch