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.
I was able to configure this by adding new value to the registry.
OS: Windows 7 Enterprise x64
Steps on how to do it.
- Run: Regedit (alt + r, type regedit)
- Look for **HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations**
- Right click "SystemFileAssociation" -> add new key then name it as .cs
- Right click .cs and add new key then name it as shell
- Right click shell and add new keys name it as edit and open 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 - 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.
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.
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.
精彩评论