views:

8484

answers:

7

When I debug in Visual Studio, firefox opens and that is annoying because of the hookups that IE and VS have such as when you close the IE browser that starting debug opened, VS stops debugging. How can I get Visual Studio to open IE instead without having to set IE as my default browser?

+5  A: 

Right-click on an aspx file and choose 'browse with'. I think there's an option there to set as default.

Travis
+1 as yours was first
Richard Szalay
+43  A: 

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.

Jon Limjap
This option is not available with MVC projects, for whatever reason
xximjasonxx
It is available for MVC projects, but you need to find the Default.aspx file for the project.
1kevgriff
Or u can add any aspx page and then right click on it ;)
Wahid Bitar
MVC2+ doesnt use a .aspx landing page
xximjasonxx
A: 

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.

rp
+6  A: 

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/...

jasonpenny
Thanks for that. Everytime I patch VS it resets the default browser back to IE. It was driving me nuts opening a webforms project just so I could change it back to Firefox.
Nick
In MVC 2 Default.aspx no longer exists. in 2010 you have to create a basic webform page, set the default (since it doesnt hold from project to project). You can then remove the excess webform
xximjasonxx
A: 

Note that this is almost certainly a political decision on Microsoft's part. When the modern era of VS was being designed - VS 2003 or so - regulators were still very keen to avoid Microsoft pushing IE in any way. It would have been politically unfeasible to have VS default to anything except the user's chosen browser.

I remember about the same time, MS put out a patch for ?Media Player? because one of the menu items that opened a web page used IE instead of the default browser.

Aric TenEyck
A: 

Quick note if you don't have an .aspx in your project (i.e. its XBAP) but you still need to debug using IE, just add a htm page to your project and right click on that to set the default. It's hacky, but it works :P

Geoff
+6  A: 

In vs2010 the default browser gets reset often (just about every time a IDE setting is changed or even after restarting vs). There is now a Default browser selector Extension for 2010 to help combat this:

http://visualstudiogallery.msdn.microsoft.com/en-us/bb424812-f742-41ef-974a-cdac607df921

alt text

Tim Santeford
Thanks a lot. It's very cool extension!
RredCat