VS2010 Tips #14: How change the default browser used in debugging ASP.NET MVC 2 application

Changing default browser used in debugging ASP.NET MVC 2 is a bit tricky in Visual Studio 2010. To use ScottGu’s steps, you will need to add new ASPX page first. But unfortunately if you delete the page then close the application, anytime you rerun the application then the change you did will lost (it backs to use the default browser set in OS).

In my case I have Firefox set as my default browser but I need to use Internet Explorer as default browser for debugging. The trick I do is by doing these:

  1. Open the project properties
  2. Go to Web tab
  3. Set the Start Action to use Start external program and then pass the Internet Explorer executable path and the url as Command line arguments.
  4. Set the Servers’ specific port to the same port set in the url in step 3.

image

(click to view the image in original size)

Make donation to this article:


 


Posted

in

,

by

Comments

7 responses to “VS2010 Tips #14: How change the default browser used in debugging ASP.NET MVC 2 application”

  1. Jerry Evans Avatar
    Jerry Evans

    Karma++. Thx.

  2. dutt Avatar
    dutt

    1. Set IE as default system browser
    2. Open VS2010.
    3. Set IE as default browser using “Browse With”
    4. Change your default system browser back to your preferred choice (while VS2010 is still open)

  3. Minela Avatar
    Minela

    Thanks! Very helpful!

  4. premkumar Avatar
    premkumar

    Thanks

  5. Todd Davis Avatar
    Todd Davis

    There is also an extension which is small and easy to use called the WOVS default browser switcher.

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

  6. Roberto Avatar
    Roberto

    Right solution for me at:
    http://stackoverflow.com/questions/2364723/how-do-i-set-my-development-web-browser-in-vs2010-rc

    ——————————————-
    n Visual Studio 2010, the Browse With option is available. However, it is not available for MVC Views!

    Simply add a Web Form or HTML Page to your project, and Browse With is readily available in it’s context menu. Here you can set the Default Browser, and that setting will be used for all subsequent debugging.
    ———————————————-

  7. bclayshannon Avatar

    I have no web tab; I have:
    Application
    Build
    Build Events
    Debug
    Resources
    Services
    Settings
    Reference Paths
    Signing

    Do I need to select “Convert to Web App” on my project to get the Web tab to show?

    It would suffice for me just to know how to change the browser on a case-by-case (or F5-by-F5) basis.

Leave a Reply

Your email address will not be published. Required fields are marked *