5

I'm using Firefox as my default browser but when working in Visual Studio, I'd like to fire up IE when I go in debug.

We all know that in MVC application, there's no way to choose the default browser unless you add a web form file, right click it, select browse with and then force a browser to be the default one. Great.

My simple question is: where does VS stores the browser I just tell him to use (registry? project file? some xml config file?) I'm asking because VS loose this preference several times a month. I'm fed up with making the brower trick again and again.

Thanks in advance, Fabian

Fabian Vilers
  • 2,892
  • 2
  • 24
  • 30

2 Answers2

1

I found these settings eventually.

They are stored in an XML file called browsers.xml in thge following directory:

**C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\Visual Studio\9.0**

The XML should look like this:

<?xml version="1.0"?>
<BrowserInfo>
<Browser>
<Name>Firefox</Name>
<Path>"C:\Program Files\Mozilla Firefox\firefox.exe"</Path>
<Resolution>0</Resolution>
<IsDefault>True</IsDefault>
<DDE>
<Service>FIREFOX</Service>
<TopicOpenURL>WWW_OpenURL</TopicOpenURL>
<ItemOpenURL>%s,,0xffffffff,3,,,</ItemOpenURL>
<TopicActivate>WWW_Activate</TopicActivate>
<ItemActivate>0xffffffff</ItemActivate>
</DDE>
</Browser>
<Browser>
<Name>Internet Explorer</Name>
<Path>"C:\Program Files\Internet Explorer\IEXPLORE.EXE"</Path>
<Resolution>0</Resolution>
<IsDefault>False</IsDefault>
<DDE>
<Service>IExplore</Service>
<TopicOpenURL>WWW_OpenURL</TopicOpenURL>
<ItemOpenURL>"%s",,0xffffffff,3,,,,</ItemOpenURL>
<TopicActivate>WWW_Activate</TopicActivate>
<ItemActivate>0xffffffff,0</ItemActivate>
</DDE>
</Browser>
<InternalBrowser>
<Resolution>0</Resolution>
<IsDefault>False</IsDefault>
</InternalBrowser>
</BrowserInfo>

The <IsDefault> tag determines whether or not the browser is used for debugging.

codingbadger
  • 42,678
  • 13
  • 95
  • 110
  • Thanks, I found the file. Next time VS tries to fool me, I'll have a look at it. Note that the file is located at C:\Users\\AppData\Local\Microsoft\VisualStudio\10.0\ on windows 7 with Visual Studio 10. – Fabian Vilers Jun 11 '10 at 11:43
  • Yes of course - I should have stated that I was using VS2008 and XP – codingbadger Jun 11 '10 at 11:44
  • 1
    Well, replacing the file with a IE configured one does not work as when I hit F5 the file is replaced by Visual Studio. Weird. :'-( – Fabian Vilers Jun 11 '10 at 18:21
  • I found the file, but this doesn't seem to work with VisualStudio 2010 and Windows 7. Also, the path for this file can be simplified: %LOCALAPPDATA%\Microsoft\VisualStudio\\ – Paul Keister Feb 06 '11 at 22:00
0

Alternately you can use this extension: http://visualstudiogallery.msdn.microsoft.com/bb424812-f742-41ef-974a-cdac607df921/

Suggest from question: Visual Studio opens the default browser instead of Internet Explorer

And, yes. This works with ASP.NET MVC applications as well.

Community
  • 1
  • 1
Custodio
  • 8,594
  • 15
  • 80
  • 115