How to jump to a file in the Source Control Explorer in Visual Studio - visual-studio-2010

I love the Solution Explorer > Right-click > "Open Containing Folder" feature of the PowerCommands extension for Visual Studio 2010. I want the equivalent of a "Jump to location in Source Control Explorer" feature. How can I find out the location in TFS of a given open file, or a file in the solution explorer (or a file in the solution navigator in you have the Productivity Power Tools extension)?
The best answer would be a couple of mouse clicks and no keyboard. Next best answer would be a hotkey mapping.
The only solution that I have found so far is to use the Productivity Power Tools extension which has the feature "Find in Source Control". A file in the results list can be right-clicked to "Open folder in Source Control Explorer". The drawbacks to this solution is that is takes many clicks, and the search results can match more than one file if files exist with the same name in different folders.

There is a stand-alone extension that you can download, called Locate in TFS, within Visual Studio.
"Locate in TFS" on TFS Gallery
"Locate in TFS" on GitHub
This also works on files that you "Exclude from source control", as many developers do with the web.config files.
psulek's post, above, mentions this as part of VSCommands, but I prefer the stand-alone extension.

Try Visual Studio extension VSCommands for Visual Studio 2012. It has feature called Locate in TFS. This will add new button to Solution Explorer Locate in TFS which opens active selected file/folder in TFS Source Control Explorer.

Feature request has been raised with Visual Studio team. Read here

I know it's probably too late. See TfsExt extension for vs2010

I'm not sure if it's possible, but it's a good suggestion.
These two examples show how to use the Visual Studio Extensibility APIs to access the TFS Source Control Explorer APIs.
http://blogs.msdn.com/b/edhintz/archive/2006/02/03/524312.aspx
http://blogs.msdn.com/b/bharry/archive/2008/07/09/working-on-tfs-sdk-improvements.aspx

For Visual Studio 2013 try lightweight extension TfsExt13

Related

How to disable Edit Project when double click on Visual Studio 2019?

On Visual Studio 2019
When I double click or even focus on project, it open Edit project
For previous version, It just only expand the project structure
How to disable this feature ?
Visual Studio 2019 (version 16.0) introduced the ability to double click on SDK-style projects in Solution Explorer and having them open in the editor.
Based on feedback, an option has been added in Visual Studio 16.1 (currently in preview) that restores the previous behaviour.
If you prefer the old behaviour, uncheck this setting.
EDITORIAL: SDK-style projects are very readable and easy to edit by hand. If you use SDK projects you may start to think of project files as regular source file and that double clicking to edit makes sense. Of course you may not, but it's worth considering.
Here the answer of #Sajeetharan again with a screenshot for a direct way to the setting that currently can be used as a workaround since the accepted answer is not working.
Of course this disables the preview from selected files in the Solution Explorer completely.
Visual Studio 2019 16.3.1:
Yes with VS2019, it is implemented the same way. There is a suggestion opened here
As of now there is no direct way to disable.You can click on the arrow to expand and see the files and structure
In Visual Studio 2022 you can do this as follows:
Go to "Tools"
Select "Options"
Select "Project and Solutions"
uncheck "Open project files with double-click or the Enter key when supported"
Done (see screenshot below)
Screenshot for visual demonstration

Do we have Git source control explorer in Visual Studio 2017?

We get source control explorer for the TFS source control model, and it is productive.
Do we get a similar source control explorer for Git in Visual Studio 2017?
If we do have it, how do I navigate to it?
In short, no, there is no built-in UI support for Git in Visual Studio 2017.
Alternatively, you can try the following extensions based on your source control setup.
In Visual Studio, select Tools → Extensions and Updates, select Online on the left pane, search for one of the following in the search bar in the top right:
Bitbucket → install Visual Studio Bitbucket Extension
GitHub → Install GitHub Extension for Visual Studio
Git → Install Easy Git Integration Tools
The first two do a good job of providing UI controls to work with source control as they relate to Bitbucket or GitHub in a similar fashion to regular TFS integration (that you may be familiar with). I haven't tried the third one myself, and I'm not sure what that one is like.
Please see the Solution Explorer - Folder View. This can be accessed from Solution Explorer (open with CTRL+W, S), then by clicking the Solutions and Folders toggle button. In Visual Studio 2017, it looks like this:
Though it's not a 1:1 capability of the Team Foundation Source Control Explorer view, it does have the ability to view files in the local repo, open, view history, etc.
Visual Studio does not currently have Source Control Explorer for Git repositories. You might consider voting on this User Voice item to help the product team prioritize features:
https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/4178754-visual-studio-tools-for-git-extension-microsoft-g
In Visual Studio 2019, open the folder for the work space using "File->Open->Folder...". The solution explorer, via "View->Solution Explorer", should display all the files which you can then right click to view history and other GIT operations.

Is there a Command in Visual Studio for "Navigate to this item in TFS Source Explorer"

I want add a command to the R-Click context menu in the Solution Explorer that would navigate the TFS Source Explorer window to the right location corresponding to the item in question.
However I can't see how to do it simply without writing a VS extension, which I want to avoid at all costs.
It's not that I don't want extensions. I just don't want to write a custom one. Previously I'd be able to use macros but those were removed in these versions of Visual Studio.
The VSCommands extension will give you the option to locate a file in TFS and in the Solution Explorer
The Locate in TFS extension adds a context menu entry Locate in TFS to Solution Explorer and Open Tabs.

How to find a file by name in the filter tree in Visual Studio Express?

Suppose I know that a file of a certain name is in a project in Visual C++ 2010 Express. I can see it in the "Show All Files" list. Is there any way to find out where it lurks in the "filter" hierarchy, short of laboriously opening each folder and looking? (As an example of what I would wish for, in Xcode one can right-click on a file and choose "Reveal in Group Tree".)
VsCommands is an extension to Visual Studio that has a 'locate in solution' option for a file that is already open in your editor.

How do you clear your MRU list in Visual Studio?

I want to clear the list of projects on the start page...how do I do this? I know I can track it down in the registry, but is there an approved route to go?
There is an MSDN article here which suggests that you just move the projects to a new directory.
However, as you mentioned, the list of projects is kept in the registry under this key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\ProjectMRUList
and the list of recent files is kept in this key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\FILEMRUList
Note For Visual Studio 2015:
The location has changed. You can check out this answer for details.
Some people have automated clearing this registry key with their own tools:
Visual Studio Most Recent Files Utility
Add-in for cleaning Visual Studio 2008 MRU Projects list
PowerCommands for Visual Studio 2008
Features
Clear Recent File List
Clear Recent Project List
Clear All Panes
Copy Path
Email CodeSnippet
Insert Guid Attribute
Show All Files
Undo Close
Collapse Projects
Copy Class
Paste Class
Copy References
Paste References
Copy As Project Reference
Edit Project File
Open Containing Folder
Open Command Prompt
Unload Projects
Reload Projects
Remove and Sort Usings
Extract Constant
Transform Templates
Close All
If you try opening up a project that can no longer be found, Visual Studio will prompt you for permission to remove it from the MRU list. So if you temporarily rename an appropriate top level folder to fake the projects' disappearance, you can get rid of the projects one by one.
In Visual Studio 2015 all the history lists (including search history, file MRU and project MRU) are now located at:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\MRUItems
You will see a different GUID folder for each list, and a sub-folder called Items in each of them. Find the Items folder that contains the relevant list, and just delete its parent GUID folder.
Visual Studio will re-create the GUID folder together with a new Items child folder, next time it wants to add something to the list again.
I found the MRU editor from Code Project a great tool for that. No problems with it, and it works on 2003, 2005, and 2008.
Note: This answer is specific to Visual Studio 2010.
If you don't want to manually edit the registry, you can use PowerCommands for Visual Studio 2010.
PowerCommands 10.0 is a set of useful extensions for the Visual Studio
2010 adding additional functionality to various areas of the IDE.
The specific command for clearing the registry from the extension is:
Clear Recent Project List This command clears the Visual Studio recent project list. The Clear Recent Project List command brings up a
Clear File dialog which allows any or all recent projects to be
selected.
The PowerCommands can be installed with the Visual Studio extension manager: Tools > Extension Manager > Online Gallery: search for PowerCommands for Visual Studio 2010.
Try Recently Used Files: a free addin for Visual Studio that manages MRU files on a per-project basis:
Supported for VS 2010, 2012, 2013.
For Visual Studio 2012, 2013:
http://visualstudiogallery.msdn.microsoft.com/a61cbd1d-b5a2-490b-a6bb-f0ea3ecf214a
For Visual Studio 2010:
http://visualstudiogallery.msdn.microsoft.com/45283881-5a62-4dc1-8ffb-4cbc02709947
For Visual Studio 2013:
Open the Run dialog (Press Win + R)
type: regedit
navigate to: HKEY_CURRENT_USER > Software > Microsoft > VisualStudio
click 12.0 then the files will show up on the right side.
Look for the "LastLoadedSolution", right click then click Modify
change the value to 0.
This worked for me.
I'm not sure if this solution has been posted somewhere here, but if you have VS 2013 Update 5 you can open start page, and right click project below "Recent" list, and choose "Remove from list". I don't know how about other VS versions, maybe this feature is available.
I had this issue as applied to VS 2017 where you do not have any MRU items in the registry as in the previous versions. The solution was, on the other hand, simple: go to "Tools->Extensions and Updates" and install "Power Commands for Visual Studio". After they have been installed, your File menu will look as shown below.
Just click the menu item to clear the project MRU.

Resources