views:

281

answers:

2

Certain non-project files that I use Visual studio for (.build, .xml, free-roaming html and css files) are already associated with visual studio and open in it when i double click them.

How can I get them to open in an existing instance of visual studio? Right now If i double-click the same file twice, it will open two instances of visual studio, I'd like it just to basically ignore the second open attempt if there is already an instance of VS open.

+1  A: 

Which version of VS?

For 2003, there's VSEdit.

In 2005, well, that's the way it works for me out-of-the-box. A quick Google search found something that may help.

Hope that helps.

Richard Morgan
altered question to show vs 2008. Thanks for the link.
Jeff Martin
+1  A: 

Ok Richard helped point me in the right direction a bit, but I think I found exactly what I want.

  1. from an explorer window, go to Tools->Folder Options->File Types tab
  2. find the extension you wish to change.
  3. If there is a restore button click it.
  4. Click Advanced
  5. Click New... to create a new action.
  6. I set the following:

Action: Open in VS 2008
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" /dde
check use dde
DDE Message: Open("%1")
Application: VisualStudio.9.0
DDE Application Not Running: (left blank)
Topic: System

  1. Hit Ok
  2. Set the new action as the default.
  3. Hit Ok, Hit Ok

Now that extension will behave exactly as described in the question. The file will open in an existing VS if visual studio is already open.

I also used this to fix a few extensions that got broken when I reinstalled VS 2005 after 2008.

Jeff Martin