35

Firefox is set as Windows' default browser.

I want to change the default browser used by Visual Studio for debugging. Normally the route I'd take to do this is right clicking on an .aspx file and setting the default from the Browse With... dialog.

Unfortunately, ASP.NET MVC Views don't have the Browse With... option.

alt text

In what other ways can you set the default browser for ASP.NET MVC projects?

Related, but NOT ASP.NET MVC specific:
Visual Studio opens the default browser instead of Internet Explorer

5
  • answer here Commented Jun 23, 2009 at 14:01
  • I deploy app on IIS and use a browser bookmarks for this purpose. Commented Jun 23, 2009 at 14:02
  • 1
    Duplicate: stackoverflow.com/questions/79954/… Commented Jun 23, 2009 at 14:05
  • 3
    @Richard: Not a duplicate. That answer does not apply to MVC projects. Commented Jun 23, 2009 at 14:07
  • hanselman.com/blog/… Commented Aug 21, 2010 at 13:20

10 Answers 10

33

For MVC1:

  • there is a default.aspx just right click on the page and select browse with and a dialog pops out for you to set your default browser.

For MVC2:

  • we need to trick the project a little bit. There are 2 ways
    1.) You can add default.aspx on the project, just right click on the project and add a new item then select MVC 2 view page and then name it default.aspx and there you can right click it and do the same steps on changing the default browser for mvc1.

    2.) You can add an html page anywhere within the project and after adding it just right click and select browse with and just do the same steps on changing the default browser for mvc1.

For VS2010:

Sign up to request clarification or add additional context in comments.

1 Comment

Dead link, can you name the extension linked to?
20

There appears to be an answer here

If you right click on any page other than default.aspx you will not get the "browse with" option.

So, when working on an ASP.NET MVC application, right click on default.aspx and chose "Browse With..." Then you'll get a dialog that will allow you to change your default browser.

4 Comments

this no longer applies for ASP.NET MVC3 projecs. You need to specifically add a .htm or .html page, and then right click that and choose Browse With and set to default. You no longer get the Browse With context menu with a regular .aspx
This answer should be removed or at least be changed to MVC 1 and 2.
then you can go for my answer by using an extension for default browser switcher
On ASP.Net MVC 4, just add a Default.aspx file in the root folder. This advice still works.
17

For MVC 4.

select the view folder. right click , you can see the browse with option. and select the browser you want.

EDIT

Another way, Thanks to Chris O

"That didn't work for me, instead I found the Browse With context menu item in another dir, App_Start, which seemed to work"

1 Comment

That didn't work for me, instead I found the Browse With context menu item in another dir, App_Start, which seemed to work.
3

MVC 3

Right click on your web project that you want to view in a non IE browser, select "Debug/Start New Instance". Then go to your system tray and you will see an icon with the image of a web page and a cog in the corner. Right click the icon and select "Open in web browser". The site will open in your default browser.

Comments

2

Might be zombie threading, but I was overcomplicating this on VS2015. You can [now?] simply select which browser should open when you hit F5 to start debugging by selecting it here, no extensions needed:

The browser selection drop-down in VS2015

Yes, yes that does list Seamonkey as an option.

1 Comment

Insane that this is so far down. In at least VS 2019, the option is a submenu of the Play button under "web browser".
1

For an ASP.NET MVC 2 project in Visual Studio 2010 I've found that

  • you need to have an .aspx file in the root of the project (the folder where also global.asax and web.config is located). Having an .aspx file in any subfolder like "Views" is not sufficient.
  • the name of this .aspx file doesn't matter, it isn't necessary to name it default.aspx

Then the context menu offers a Browse with... option when right-clicking on this file in the solution explorer.

Comments

1

In visual studio 2010 you can use this extension: World of VS Default Browser Switcher

Comments

1

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:

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.

Comments

0

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 other browser name (ex:firefox.exe) filename

4) Click the "Set as Default" button to make this the default browser when you run any page on the site.

3 Comments

See my post - 'Normally the route I'd take to do this is right clicking on an .aspx file and setting the default from the 'browse with' dialog. Unfortunately, MVC views don't have the browse with option.'
Right click on a .aspx page in your solution explorer
@Chells: For MVC projects, that only works if you click on default.aspx, not just any aspx page.
0

Please use Default browser switcher extension for Visual Studio 2010. It allows you select one of the installed browsers as the default browser for that dev. session and it works for all .NET web projects.

Steps to install this extension : Tools - > Extension manager and search for Default browser .. Select WoVS Default Browser Switcher, download and install. Restart your VS 2010 and open an mvc project. Enable the Default browser switcher tool bar and notice that it has enabled the browsers that are available on the machine.

Cheers, Kiran Banda

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.