Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Visual Studio Default Browser in an ASP.NET MVC project

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

like image 317
Kirschstein Avatar asked Jun 23 '09 14:06

Kirschstein


People also ask

How do I change the default page in ASP NET MVC?

Just change the Controller/Action names to your desired default. That should be the last route in the Routing Table. In MVC 5. if you have a form login, when you click login on the home page, it will then still redirect to Home controller , not your custom controller specified in the route.

How do I change my default browser in Visual Studio 2019?

Tools -> Options -> Search for "browser" -> View Source in "external editor" -> put the path to your preferred.

How do I set Chrome as my default browser in asp net?

Right click on an . aspx file and click "Browse with..." then select Chrome and click "Set as Default." You can select more than one browser in the list if you want.


2 Answers

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:

  • You can try this extension. It is safe, hopefully this will be added in the next releases of Visual Studio.

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

like image 152
4 revs, 2 users 94% Avatar answered Oct 11 '22 17:10

4 revs, 2 users 94%


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.

like image 24
Matthew Jones Avatar answered Oct 11 '22 16:10

Matthew Jones