开发者

Where does Visual Studio stores the default browser to use in debug?

开发者 https://www.devze.com 2023-01-03 04:04 出处:网络
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.

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 d开发者_StackOverflow中文版efault 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


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.


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.

0

精彩评论

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