Nam G VU
Nam G VU

Reputation: 35404

How to change default program (notepad) which opens a selected file when viewing a TFS changeset in Visual Studio 2010?

I open the History in the Source Control, then open a changeset, then select a file in the file list and double click to open it. TFS open the file by Notepad, I wanna open the file by Visual Studio or by any other text editor (to have syntax highlight). How can I do this?

PS. In my machine, when I open a .config file like app.config, TFS ask for a program to open it! I want TFS ask for the .cs file also! There must be somewhere to set this I guess.

Upvotes: 3

Views: 5581

Answers (3)

Don Jwan1000
Don Jwan1000

Reputation: 31

All files saved in TFS are saved in a path that starts with the following address: http ://YourServerNametfs01:8080/tfs/.../.../...&FileName=YourFileName.YourExt

This means that all files are opened using the default program defined for HTTP protocol, regardless of the extension for your file. You can probably change the default program for your HTTP protocol (if you have permissions, and usually you wouldn't) but this would also affect opening any regular web page or URL, which is probably not recommended.

I still haven't found a workaround this issue too.

Upvotes: 2

Krozen
Krozen

Reputation: 161

I was able to configure this by adding new value to the registry.

OS: Windows 7 Enterprise x64

Steps on how to do it.

  1. Run: Regedit (alt + r, type regedit)
  2. Look for **HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations**
  3. Right click "SystemFileAssociation" -> add new key then name it as .cs
  4. Right click .cs and add new key then name it as shell
  5. Right click shell and add new keys name it as edit and open 6
  6. Right click edit and add new key command then change the default value to point to the file exe you want it to run. ex: C:\Program Files (x86)\Notepad++\notepad++.exe %1
    Don't forget to add the %1 at the end of the .exe
  7. do the same for open
    Just change the open and edit default value to the executable you want to run it with but don't forget to have the %1 as that will be the parameter given by tfs I assume.

    Hope it helps.

Upvotes: 13

acidRain
acidRain

Reputation: 414

The only thing that works for me is when I set the default program for a file in Windows Explorer to open with the VS IDE:

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe

Might work similarly for 2010.

Upvotes: 1

Related Questions