有没有办法禁用 Visual Studio Web 浏览器?我只是希望它在我按住 ctrl-单击评论中的超链接时启动我的实际浏览器。
我看到在...上找到Web Browser
的选项卡中有一个选项,但似乎没有办法完全禁用它。Environment
Tools --> 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 的开头,然后按热键来使用它。比突出显示整个内容以将其复制/粘贴到浏览器中要容易一些。