views:

621

answers:

4

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?

A: 

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

backslash17
I thought of this too, but it does not apply to links directly in the source code, only to links in, say, the Help.
Matthew Jones
You're right only links in the internal navigator not in the source code pane.
backslash17
-1 does not answer the question. :-)... If anyone has a solution that does not involve right click menu or CTRL click that would be even better :-)
Myster
A: 

Maybe you should write a plug in?

Haim Bender
A: 

There is a full description of a solution here: http://stevenharman.net/blog/archive/2007/08/02/setting-a-default-browser-for-visual-studio.aspx

There is a handy link for VS2005 half way down by capgpilk

System.Exception
That only deals with running HTML pages, right? Not links in the text editor? Or am I missing something?
Roger Lipscombe
+2  A: 

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...

mracoker
I don't have VB installed but it looks like it'll work (if there is nothing at the end of the line past the URL), plus I hate having un-answered questions, so marking as answer. Thanks for your help :)
Sam Pearson
@Sam: You don't need VB installed to use Visual Studio macros. They just use the same syntax.
Roger Lipscombe