0

有没有办法禁用 Visual Studio Web 浏览器?我只是希望它在我按住 ctrl-单击评论中的超链接时启动我的实际浏览器。

我看到在...上找到Web Browser的选项卡中有一个选项,但似乎没有办法完全禁用它。EnvironmentTools --> Options

如果没有本地方法可以做到这一点,欢迎扩展。

因此,当我单击评论时(此处的示例显示了 XML 文件中的评论) 在此处输入图像描述

我希望它启动 Chrome,而不是 Visual Studio 中的这个内置 IE 选项卡 在此处输入图像描述


编辑我将此问题标记为另一个问题的重复。有人提供了这个宏:

Sub OpenURLInChrome()

    ' Select to end of line
    DTE.ActiveDocument.Selection.EndOfLine(True)
    Dim selection As TextSelection = DTE.ActiveDocument.Selection

    ' Find URL within selection
    Dim match = System.Text.RegularExpressions.Regex.Match(selection.Text, ".*(http\S+)")

    Dim url As String = ""
    If (match.Success) Then
        If match.Groups.Count = 2 Then
            url = match.Groups(1).Value
        End If
    End If

    ' Remove selection
    selection.SwapAnchor()
    selection.Collapse()

    If (url = String.Empty) Then
        MsgBox("No URL found")
    End If

    'launch chrome with url
    System.Diagnostics.Process.Start(url)
End Sub

然后将其绑定到一个键,然后通过将光标设置在 URL 的开头,然后按热键来使用它。比突出显示整个内容以将其复制/粘贴到浏览器中要容易一些。

4

2 回答 2

3

我认为 VS 2010 环境不允许你这样做,请通过链接,有一些 shell 允许你这样做

https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2723548-open-links-in-an-actual-browser

http://social.msdn.microsoft.com/Forums/vstudio/en-US/22ffd60b-5fcf-4ed4-b42c-546d389b4be1/open-url-in-external-browser

如果你找到方法请发帖

于 2013-11-08T20:37:22.143 回答
0

右键单击 aspx 页面并选择浏览器进行浏览,然后选择默认,如下所示:

http://www.hanselman.com/blog/HowToChangeTheDefaultBrowserInVisualStudioProgrammaticallyWithPowerShellAndPossiblyPokeYourselfInTheEye.aspx

如果您的项目中没有 aspx 页面,他们还会详细介绍如何修复它

于 2013-11-08T20:25:36.380 回答