将Google Chrome设置为Visual Studio中的调试浏览器

时间:2022-05-14 03:04:07

When I press F5 in Visual Studio 2008, I want Google Chrome launched as the browser that my ASP.NET app runs in. May I know how this can be done?

当我在Visual Studio 2008中按F5时,我希望将Google Chrome作为我的ASP.NET应用程序运行的浏览器启动。我可以知道如何做到这一点吗?

7 个解决方案

#1


67  

Right click on an .aspx file and click "Browse with..." then select Chrome and click "Set as Default." You can select more than one browser in the list if you want.

右键单击.aspx文件,然后单击“浏览方式...”,然后选择Chrome并单击“设为默认值”。如果需要,您可以在列表中选择多个浏览器。

There's also this really great WoVS Default Browser Switcher Visual Studio extension.

还有这个非常棒的WoVS默认浏览器切换器Visual Studio扩展。

#2


26  

To add something to this (cause I found it while searching on this problem, and my solution involved slightly more)...

要添加一些内容(因为我在搜索此问题时找到了它,而我的解决方案涉及的更多)...

If you don't have a "Browse with..." option for .aspx files (as I didn't in a MVC application), the easiest solution is to add a dummy HTML file, and right-click it to set the option as described in the answer. You can remove the file afterward.

如果您没有.aspx文件的“Browse with ...”选项(因为我没有在MVC应用程序中),最简单的解决方案是添加一个虚拟HTML文件,然后右键单击它以设置选项如答案中所述。您可以在以后删除该文件。

The option is actually set in: C:\Documents and Settings[user]\Local Settings\Application Data\Microsoft\VisualStudio[version]\browser.xml

该选项实际上设置为:C:\ Documents and Settings [user] \ Local Settings \ Application Data \ Microsoft \ VisualStudio [version] \ browser.xml

However, if you modify the file directly while VS is running, VS will overwrite it with your previous option on next run. Also, if you edit the default in VS you won't have to worry about getting the schema right, so the work-around dummy file is probably the easiest way.

但是,如果在VS运行时直接修改文件,VS将在下次运行时使用您之前的选项覆盖它。此外,如果您在VS中编辑默认值,则无需担心正确使用架构,因此解决方法虚拟文件可能是最简单的方法。

#3


12  

For MVC developers,

对于MVC开发人员,

  • click on a folder in Solution Explorer (say, Controllers)
  • 单击解决方案资源管理器中的文件夹(例如,控制器)
  • Select Browse With...
  • 选择浏览...
  • Select desired browser
  • 选择所需浏览器
  • (Optionally click ) set as Default
  • (可选择单击)设置为默认值

#4


7  

  1. Go to the visual studio toolbar and click on the dropdown next to CPU. One of the choices should be "Browse With..."

    转到visual studio工具栏,然后单击CPU旁边的下拉列表。其中一个选择应该是“浏览...”

    将Google Chrome设置为Visual Studio中的调试浏览器

  2. Select a browser, e.g. Google Chrome, then click "Set as Default".[![enter image description here]

    选择一个浏览器,例如谷歌浏览器,然后单击“设为默认值”。[![在此处输入图像说明]

    将Google Chrome设置为Visual Studio中的调试浏览器

  3. Click Browse or Cancel.

    单击浏览或取消。

#5


5  

If you don't see the "Browse With..." option stop debugging first. =)

如果您没有看到“浏览...”选项,请先停止调试。 =)

#6


2  

in visual studio 2012 you can simply select the browser you want to debug with from the dropdown box placed just over the code editor

在visual studio 2012中,您只需从代码编辑器上方的下拉框中选择要调试的浏览器即可

#7


0  

For win7 chrome can be found at:

对于win7 chrome,可以在以下位置找到:

C:\Users\[UserName]\AppData\Local\Google\Chrome\Application\chrome.exe

For VS2017 click the little down arrow next to the run in debug/release mode button to find the "browse with..." option.

对于VS2017,单击“调试/释放模式”按钮旁边的小向下箭头,找到“使用浏览...”选项。

#1


67  

Right click on an .aspx file and click "Browse with..." then select Chrome and click "Set as Default." You can select more than one browser in the list if you want.

右键单击.aspx文件,然后单击“浏览方式...”,然后选择Chrome并单击“设为默认值”。如果需要,您可以在列表中选择多个浏览器。

There's also this really great WoVS Default Browser Switcher Visual Studio extension.

还有这个非常棒的WoVS默认浏览器切换器Visual Studio扩展。

#2


26  

To add something to this (cause I found it while searching on this problem, and my solution involved slightly more)...

要添加一些内容(因为我在搜索此问题时找到了它,而我的解决方案涉及的更多)...

If you don't have a "Browse with..." option for .aspx files (as I didn't in a MVC application), the easiest solution is to add a dummy HTML file, and right-click it to set the option as described in the answer. You can remove the file afterward.

如果您没有.aspx文件的“Browse with ...”选项(因为我没有在MVC应用程序中),最简单的解决方案是添加一个虚拟HTML文件,然后右键单击它以设置选项如答案中所述。您可以在以后删除该文件。

The option is actually set in: C:\Documents and Settings[user]\Local Settings\Application Data\Microsoft\VisualStudio[version]\browser.xml

该选项实际上设置为:C:\ Documents and Settings [user] \ Local Settings \ Application Data \ Microsoft \ VisualStudio [version] \ browser.xml

However, if you modify the file directly while VS is running, VS will overwrite it with your previous option on next run. Also, if you edit the default in VS you won't have to worry about getting the schema right, so the work-around dummy file is probably the easiest way.

但是,如果在VS运行时直接修改文件,VS将在下次运行时使用您之前的选项覆盖它。此外,如果您在VS中编辑默认值,则无需担心正确使用架构,因此解决方法虚拟文件可能是最简单的方法。

#3


12  

For MVC developers,

对于MVC开发人员,

  • click on a folder in Solution Explorer (say, Controllers)
  • 单击解决方案资源管理器中的文件夹(例如,控制器)
  • Select Browse With...
  • 选择浏览...
  • Select desired browser
  • 选择所需浏览器
  • (Optionally click ) set as Default
  • (可选择单击)设置为默认值

#4


7  

  1. Go to the visual studio toolbar and click on the dropdown next to CPU. One of the choices should be "Browse With..."

    转到visual studio工具栏,然后单击CPU旁边的下拉列表。其中一个选择应该是“浏览...”

    将Google Chrome设置为Visual Studio中的调试浏览器

  2. Select a browser, e.g. Google Chrome, then click "Set as Default".[![enter image description here]

    选择一个浏览器,例如谷歌浏览器,然后单击“设为默认值”。[![在此处输入图像说明]

    将Google Chrome设置为Visual Studio中的调试浏览器

  3. Click Browse or Cancel.

    单击浏览或取消。

#5


5  

If you don't see the "Browse With..." option stop debugging first. =)

如果您没有看到“浏览...”选项,请先停止调试。 =)

#6


2  

in visual studio 2012 you can simply select the browser you want to debug with from the dropdown box placed just over the code editor

在visual studio 2012中,您只需从代码编辑器上方的下拉框中选择要调试的浏览器即可

#7


0  

For win7 chrome can be found at:

对于win7 chrome,可以在以下位置找到:

C:\Users\[UserName]\AppData\Local\Google\Chrome\Application\chrome.exe

For VS2017 click the little down arrow next to the run in debug/release mode button to find the "browse with..." option.

对于VS2017,单击“调试/释放模式”按钮旁边的小向下箭头,找到“使用浏览...”选项。