How do you clear your MRU list in Visual Studio? - 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.

Related

Visual Studio files association in Windows

In Windows Explorer when I double-click on any Visual Studio file (*.cs, *.csproj, etc.), it's opening an old version of VS instead of the latest one (VS 2017). And VS has associations with too many file types.
How can I change the default Visual Studio (for all those files that VS can handle)?
There is a similar old question about Visual Studio 2008 (Move file associations from Visual Studio 2005 to 2008) but the solution in there doesn't work anymore (there is no "Restore File Associations" button on the settings of Visual Studio 2017).
Each version of Visual Studio registers itself in the Set Default Programs panel of the Control Panel.
Go to Control Panel\Programs\Default Programs
Then choose Set Default Programs:
In there you can simply choose the Visual studio version of your choice and then click the button Set this program as default in order to associate every file type that VS handles.
Or you might prefer to click the button Choose defaults for this program to review the current associations of those file types and change only the ones you want.
Yet another in a long list of previously working-just-fine things which Microsoft have managed totally #$#%# up. If I try to change defaults the 'right' way I get this kind of thing:
i.e. completely ignored. The only way I've managed to solve it is by removing the file association entirely through the registry. Let's take .asm as an example:
Open Registry Editor / "regedit.exe"
Navigate to HKEY_CLASSES_ROOT\.asm\OpenWithProgIds
Delete any Visual Studio values you see
From there, you can (finally) open files with whatever you choose instead of having the association clamped to Visual Studio:
For the record, I believe this to be a problem with Windows 10. Not with Visual Studio. See: https://answers.microsoft.com/en-us/windows/forum/windows_10-files/cant-change-default-programs-in-windows-10/229fc3a9-25c9-433b-a333-5806bc5090db
On the file you will always open with vs17, click right and choose open with and there choose another app. On win10 it pop out a dialog with some proposals. If vs17 is there, choose your favorite and activate the always open with. then ok and your done.

Where are the default file/folder ignore rules for Visual Studio TFS stored?

When I add a solution to TFS through the Visual Studio 2013 "Add solution to source control" menu option certain (build output) files and folders are automatically ignored. I know I can create a .tfignore file to customise this behaviour, and that is not what I'm asking about. Can anyone tell me where the default Visual Studio standard exclusion list is stored?
See https://stackoverflow.com/a/43227500/117965
File is located at %LocalAppData%\Microsoft\Team Foundation\7.0\Configuration\VersionControl\
I don't think there is a list, Visual Studio just places common Binary files onto the "Excluded" tab. It has been this way since TFS 2010. I don't even think messing with the Team Project Collection's Source Control options for multiple checkouts can help.
If there is a list, I'd guess it is in the registry somewhere.

Visual Studio 2010 Toolbox Is Empty

My toolbox is empty.
Obviously, I'm not the first. I read this question and this other question, but that didn't help.
I click here...
I get this window...
With instructions that say: "...Drag an item onto this text, to add it to the toolbox..."
Sounds good; from where do I get such items to drag?
The toolbox is empty because there is no project loaded.
The toolbox is populated with tools/controls according to the type of the current project. The controls are different for MFC than they are for ASP.NET, for example. If you haven't loaded any project, Visual Studio can't populate the toolbox.
Either open an existing project, or go to File -> New Project to create a new one.
Have you tried right-clicking on it and selecting the "Reset Toolbox" option? You can also try to manually add specific tools to it by using the "Choose Items..." option.
A common suggest is also to go into the Visual Studio 2010 Directory and delete all of the .tbd files within the following directory (Related) :
C:\Documents and Settings\Local Settings\Application Data\Microsoft\VisualStudio\10.0"
Although if neither of these options work, you will really want to consider possibly reinstalling / repairing Visual Studio.
Is your project running? I noticed that my toolbox is empty when I am debugging the project. Try stopping debugging.

Remove Unused Using in VS 2012 Premium

I am using Microsoft Visual Studio Premium 2012.
Microsoft directions states:
Main Menu - On the Edit menu, point to IntelliSense, point to Organize Usings, and then click Remove Unused Usings.
However, there is no option called "Organize Usings" in the "Intelliense" menu on the "Edit" menu-tab. I can use the context-menu to accomplish this...but that option only appears for a single open code-behind file (when I have it open). Doing so one code-file at-a-time is useless to me in a large project.
Also...
I have looked at other questions for previous version of Visual Studio on this site, and their answers don't work in 2012 Premium.
So my question is...
How can I "Remove Unused Usings" within Microsoft Visual Studio Premium 2012 across a single project or solution?
You would probably have to write a Visual Studio Extension to do this.
You can use the Macro at this link that opens all files of your project and remove unused usings. Otherwise PowerCommands contains some useful extensions, including one that remove all unused usings (never tested it though).

How to jump to a file in the Source Control Explorer in Visual Studio

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

Resources