visual-studio 如何在 VS2010 RC 中设置我的开发 Web 浏览器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2364723/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I set my development web browser in VS2010 RC?
提问by Ben Lesh
I don't like to use IE for my system default web browser.
我不喜欢将 IE 用于我的系统默认 Web 浏览器。
but
但
I do want to set IE as my browser in VS2010 because it works a little nicer for debugging and I like to develop to the lowest common denominator. (jab, lol)... anyhow, can I default to debugging against IE?
我确实想在 VS2010 中将 IE 设置为我的浏览器,因为它更适合调试,而且我喜欢开发到最小公分母。(jab, lol)...无论如何,我可以默认针对 IE 进行调试吗?
I know in VS2008 you just had to "Browse With..." on an .aspx page. But that option doesn't exist in VS2010 RC. What gives?
我知道在 VS2008 中你只需要在 .aspx 页面上“浏览...”。但是该选项在VS2010 RC中不存在。是什么赋予了?
采纳答案by Oded
This is for VS2008, but should apply just as well to VS2010.
这适用于 VS2008,但也适用于 VS2010。
You have several options.
您有多种选择。
Go to the web project properties to the "web" tab.
转到 web 项目属性到“web”选项卡。
Option 1:
选项1:
- Under "Start Action", select "Start External Program" and set the path to your browser of choice, pass the URL in through the command line parameters
- 在“启动操作”下,选择“启动外部程序”并设置您选择的浏览器的路径,通过命令行参数传入 URL
Option 2:
选项 2:
- Setup your machine to use your browser of choice as the default browser.
- Under "Start Action", select "Start URL". This will invoke the default browser.
- 将您的机器设置为使用您选择的浏览器作为默认浏览器。
- 在“开始操作”下,选择“开始 URL”。这将调用默认浏览器。
回答by Peter
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 isavailable. However, it is notavailable for MVC Views!
在Visual Studio 2010中,浏览方式选项是可用的。但是,它不适用于 MVC 视图!
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.
只需将 Web 表单或 HTML 页面添加到您的项目中,即可在其上下文菜单中轻松使用“浏览方式”。您可以在此处设置默认浏览器,该设置将用于所有后续调试。
回答by Stuntbeaver
The "World of VS Default Browser Switcher" vs2010 extension will select your desired browser for you and it works with MVC too. This is a free extension :)
“VS 默认浏览器切换器世界”vs2010 扩展程序将为您选择所需的浏览器,它也适用于 MVC。这是一个免费的扩展:)
http://visualstudiogallery.msdn.microsoft.com/en-us/bb424812-f742-41ef-974a-cdac607df921
http://visualstudiogallery.msdn.microsoft.com/en-us/bb424812-f742-41ef-974a-cdac607df921
It was originally built based on a post by Scott Hanselman http://www.hanselman.com/blog/HowToChangeTheDefaultBrowserInVisualStudioProgrammaticallyWithPowerShellAndPossiblyPokeYourselfInTheEye.aspx
它最初是基于 Scott Hanselman http://www.hanselman.com/blog/HowToChangeTheDefaultBrowserInVisualStudioProgrammaticallyWithPowerShellAndPossivelyPokeYourselfInTheEye.aspx的帖子构建的
回答by Dave Forster
"Browse With..." only appears in VS2010 (aspx page context menu) when you already have IE set as the default browser for everything (system). It's there to let you select an alternate browser to IE.
当您已经将 IE 设置为所有内容(系统)的默认浏览器时,“浏览方式...”仅出现在 VS2010(aspx 页面上下文菜单)中。它可以让您选择 IE 的替代浏览器。
This is a big #fail in my opinion. I've had moderate success with thtese steps.
在我看来,这是一个很大的#fail。我已经通过这些步骤取得了一定的成功。
- Set IE as default system browser
- Open VS2010.
- Set IE as default browser using "Browse With"
- Change your default system browser back to your preferred choice (while VS2010 is still open)
- 将 IE 设置为默认系统浏览器
- 打开VS2010。
- 使用“浏览方式”将 IE 设置为默认浏览器
- 将您的默认系统浏览器更改回您的首选选择(VS2010 仍处于打开状态)
I say moderate results because the settings don't seem to persist or aer randomly persisted at best.
我说中等结果是因为这些设置似乎不会持续存在,或者充其量只是随机持续存在。
回答by Curtis
"Browse With..." Will not show up when you are in debug mode, FYI. That's probably why you think it's missing.
“Browse With...”在调试模式下不会出现,仅供参考。这可能就是您认为它丢失的原因。
回答by Sayeed S. Alam
right click on the project . Then add-> new item -> HTML Page
右键单击该项目。然后添加-> 新项目-> HTML 页面
A "HTMLPage1.htm" will be added to the project. "Browse With ..." exists in its context menu. Use its Browse With menu then delete the file after done.
“HTMLPage1.htm”将添加到项目中。“浏览方式...”存在于其上下文菜单中。使用它的“浏览方式”菜单,然后在完成后删除文件。
回答by Marklar
Hey just found you can do this in VS2010.
嘿刚刚发现你可以在 VS2010 中做到这一点。
Right click the Web Project and go to 'Browse With' - Set the default browser in here.
右键单击 Web 项目并转到“浏览方式”- 在此处设置默认浏览器。
回答by Steve
No, Tim is right. The 'Browse With' option DOES show in VS2010 - at least in VS2010 Pro.
不,蒂姆是对的。“浏览方式”选项确实在 VS2010 中显示 - 至少在 VS2010 Pro 中。
回答by Monsignor
The 'Browse With' option does exist. But it is shown in context menu of a file\folder and not in a context menu of whole web application.
“浏览方式”选项确实存在。但它显示在文件\文件夹的上下文菜单中,而不是在整个 Web 应用程序的上下文菜单中。
You may setup default browser there.
您可以在那里设置默认浏览器。
回答by sadhana Singh
Yes Tim and Monsingor is Right go to SubFcontext menu of a file\folder and right click and set default Browser sadhana
是的,Tim 和 Monsingor 是对的,转到文件\文件夹的 SubFcontext 菜单,然后右键单击并设置默认浏览器练习

