Visual Studio 2010 defaults to an undesired browser when opening MVC projects

A while ago, I set my default browser in Visual Studio 2010 to Google Chrome by using the "Browse With..." trick, and I've been happy with it for some time. Recently I've found that I've needed to do quite a bit of testing in IE, so I wanted to change it back. I went down the "Browse With..." route again, which seemed to work... but every time I close and re-opened Visual Studio, it reset itself back to Chrome.

I've been living with it for a while, as I tend to do extended sessions anyway, so it's not been too much of a hassle... but today I've needed to close and restart Visual Studio a few times, so it's become a bit annoying. Anyway, to cut a long story short, it seems that when setting the "Browse With..." option in an MVC project, the settings aren't saved to the configuration file, probably because MVC projects don't actually have physical files to be "Browsed", unlike an ASP.Net project. I'm not making excuses for the bug, but its understandable how it's been missed. I've not worked on an ASP.Net project at home for a while, it's all been MVC.

Anyway, for anyone having the same issue as me - all you need to do is create a blank Web Application project, right click one of the generated .aspx files and click "Browse With...", then set the default browser as per normal; voila, your MVC projects will now open with your new default browser setting.

If that's not enough, Scott Hanselman, in his infinite geekiness put together a blog post a while ago outlining a workaround to give you a bit more control over the browser you run your pages in. I don't need this flexibility at the moment, but if you want to put a bit of effort in, its a pretty good solution considering the current options in Visual Studio.

The bug has been reported to Microsoft, and will hopefully be fixed in a future service pack, even though it was reported quite some time ago.

Popular posts from this blog

Handling uploads with MVC4, JQuery, Plupload and CKEditor

Getting Unity 3D working with Git on Windows

Generating a self-signed SSL certificate for my QNAP NAS