The simplest solution is to add a Web Form to your project, and then right-click that. There you have a "Browse with" option. After setting the default browser, you can remove the Web Form from your project again.
This is how: Right-click your html file -> Browse with -> Click on your favorite browser -> Set as Default.
Select the Explorer from the left toolbar. Find your HTML file in the Explorer and right-click on it. Choose “Open in Default Browser” or “Open in Other Browsers.” If you select the “Open in Default Browser” option, the HTML file will launch in whatever browser is set as default.
Scott Guthrie has made a post on how to change Visual Studio's default browser:
1) Right click on a .aspx page in your solution explorer
2) Select the "browse with" context menu option
3) In the dialog you can select or add a browser. If you want Firefox in the list, click "add" and point to the firefox.exe filename
4) Click the "Set as Default" button to make this the default browser when you run any page on the site.
I however dislike the fact that this isn't as straightforward as it should be.
In Visual Studio 2010 the default browser gets reset often (just about every time an IDE setting is changed or even after restarting Visual Studio). There is now a default browser selector extension for 2010 to help combat this:
!!!Update!!! It appears that the WoVS Default Browser Switcher is no longer available for free according to @Cory. You might try Default Browser Changer instead but I have not tested it. If you already have the WoVS plugin I would recommend backing it up so that you can install it later.
The following solution may no longer work:
WoVS Default Browser Switcher: http://visualstudiogallery.msdn.microsoft.com/en-us/bb424812-f742-41ef-974a-cdac607df921
Edit: This works with ASP.NET MVC applications as well.
Note: One negative side effect of installing this extension is that it seems to nag to be updated about once a month. This has caused some to uninstall it because, to them, its more bothersome then the problem it fixes. Regardless it is easily updated through the extension manager and I still find it very useful.
You will see the following error when starting VS:
The Default Browser Switcher beta bits have expired. Please use the Extension Manager or visit the VS Gallery to download updated bits.
For MVC3 you don't have to add any dummy files to set a certain browser. All you have to do is:
Right-click on an aspx file and choose 'browse with'. I think there's an option there to set as default.
Also may be helpful for ASP.NET MVC:
In an MVC app, you have to right-click on Default.aspx, which is the only ‘real’ web page in that solution. The default page displays ‘Browse with…’
From http://avaricesoft.wordpress.com/2008/08/04/...
If you're running an MVC 3 application - in your solution explorer click the show all files icon and then under the Global.asax file there should be a file called YourProjectName.Publish.XML right-click it and then click "Browse With..." and select your favorite browser as the default.
In the Solution Explorer, right-click any ASPX page and select "Browse With" and select IE as the default.
Note... the same steps can be used to add Google Chrome as a browser option and to optionally set it as the default browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With