How do I open links in Visual Studio in my web browser and not in Visual Studio?

Viewed 25056

If there is a URL in a source file comment, I can "CTRL + click to follow link." However, when I do this, the link opens inside Visual Studio. How can I make it open in my web browser--in my case, Google Chrome?

6 Answers

I could not find a setting for this so I wrote a simple macro that you can use. You can bind this to a key-combo like all macros. This will get the job done until we get a better answer.

Sub OpenURLInChrome()
   'copy to end of line
   DTE.ActiveDocument.Selection.EndOfLine(True)

  'set var
   Dim url As String = DTE.ActiveDocument.Selection.Text

   'launch chrome with url
   System.Diagnostics.Process.Start( _
      Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) _
      + "\Google\Chrome\Application\chrome.exe", url)
End Sub

Just put your cursor in front of the url and run the macro...

2019 Update: All the answers are old. There's now a native way to do this in options in VS2019 Community:

Options >> Web Browser

This works for me. I changed the default browser in Windows.

Windows-Support

or direct link to settings: ms-settings:defaultapps

In VS2008 , just right click on the link and select "Open link in external window". You have to select Chrome as your default browser.

Related