开发者

Change default browser in Visual Studio 2010 RC

In Visual Studio 2010 (RC) there is no longer a "browse with" context menu when right clicking .aspx pages. How can you change the default browser now?

By default it seems to use the operating system default browser,开发者_StackOverflow中文版 but I would prefer to use IE when debugging ASP.net apps. (I am testing this with ASP.net MVC 2)


this is the only working way for me: How do I set my development web browser in VS2010 RC?

There is also a browser switcher extension for Visual Studio, which works perfectly! http://visualstudiogallery.msdn.microsoft.com/bb424812-f742-41ef-974a-cdac607df921

Change default browser in Visual Studio 2010 RC

update: the extension is removed from the gallery, try this one: http://visualstudiogallery.msdn.microsoft.com/233945ae-0b7b-47e7-9b02-c5a11798afb5

Change default browser in Visual Studio 2010 RC


this browser switching extension is what i use. It's pretty awesome.

EDIT: Possible new link


There is no "Browse With" option on the .aspx Views in an MVC project as they are not meant to be directly browseable.

What I tend to do is add a Default.aspx webform in the root of the site and this, when right clicked, will give you the Browse With option. You need to make sure to update your routing though otherwise IIS/Cassini will try to serve it up, something like this

   public void Page_Load(object sender, System.EventArgs e) {
        // Change the current path so that the Routing handler can correctly interpret
        // the request, then restore the original path so that the OutputCache module
        // can correctly process the response (if caching is enabled).

        string originalPath = Request.Path;
        HttpContext.Current.RewritePath(Request.ApplicationPath, false);
        IHttpHandler httpHandler = new MvcHttpHandler();
        httpHandler.ProcessRequest(HttpContext.Current);
        HttpContext.Current.RewritePath(originalPath, false);
    }

Also, another quicky is to hit CTRL-F5 (run without debugging) which will fire up the site without going into debug mode..


I just added a .htm page and right clicked on it. There I had Browse With...


The solution really is not that difficult, though it is not as direct as it ought to be...

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

No need for complicated code in an Default.aspx page, or changing the Windows defaults.


Looks like this is going to be in a future release.

https://connect.microsoft.com/VisualStudio/feedback/details/533930/default-browser-setting-in-vs2010-not-per-project-helps-debug-user-experience

btw, you can change your default browser:- In WindowsXP atleast.. Go to Start > Control Panel > Add and Remove progam> Set Program access and defaults > Choose IE from the Web browser dropdown.

Edited: btw, I did see the "Browse with" item in the right click of an aspx page. When I click on that, I see the list of broswers to choose from. You select one an click "Set as default".


Check this out:

How do I set my development web browser in VS2010?

I'm using VS 2010 RC and I can't see the "Browse with..." option too.


"Browse With.." is available on VS2010. Left Click the empty space of top panel -> select "Web Browser". Right click .aspx, "Browse With.." is accessible now.


Go to :

C:\Users\[Your current user]\AppData\Local\Microsoft\VisualStudio\10.0\browsers.xml

clear all contents and save ------if your default browser at the windows is IE new settings change to IE ----- Compile your application


another way (and more easy) that we can do this is: open the browser that you want, for example, IE and going in Tools > Options > Programs > and click the button like "Set Default Browser"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜