Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erasing the Find/Replace History on Visual Studio 2010

Tags:

I've looked around online to try to find a way to delete the history of VS 2010's Find/Replace feature, but all I've gotten are answers only valid for previous versions (VS 05, VS 08, etc.). Does anyone know how clear it for the 2010 version? Thanks!

like image 803
Alex Flores Avatar asked Jun 26 '11 18:06

Alex Flores


People also ask

How do I replace all occurrences in Visual Studio?

You can find and replace text in the Visual Studio editor by using Find and Replace (Ctrl+F or Ctrl+H) or Find/Replace in Files (Ctrl+Shift+F or Ctrl+Shift+H). You can also find and replace only some instances of a pattern by using multi-caret selection.

How do I delete recent projects in Visual Studio 2008?

An easier solution and safer then using the registry to remove individual projects is to rename the . sln file. In VS 2008, click on the project. You will be prompted that it can no longer be found and do you want to remove it from the list.

How do I delete recent projects in Visual Studio 2015?

To remove a single project from Recent Projects list you can right click on the project and select remove. (The screenshot is in Italian, but it's clear.) Have to restart visual studio to get it removed from the file -> recent project list.


1 Answers

Open regedit.exe, go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Find. Remove all keys that starts with Find and Replace, like Find1, Find2, Replace1, etc. You can remove history for Find only or Replace only, or remove only particular Find, if you want to.

HKEY_CURRENT_USER user is for user that is currently logged in.

If you need to clear history for another user, you need to go to HKEY_USERS\{UserId}\Software\Microsoft\VisualStudio\10.0\Find

For example HKEY_USERS\S-1-5-21-2705333110-2095705488-3072420928-1000\Software\Microsoft\VisualStudio\10.0\Find.

[EDIT]

Step-by-step:

  1. Make a quick console application:

    using Microsoft.Win32;  public static void Main() {     var findKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0\Find", true);     findKey.GetValueNames()         .Where(arg => Regex.IsMatch(arg, @"^Find( \d+)?$"))         .ToList()         .ForEach(findKey.DeleteValue); } 
  2. Compile it and close VS.

  3. Run the compiled exe.
  4. Open VS - Find history is empty.

Keep in mind that VS caches this Find and Replace lists. It persists the lists to the registry when you close VS. So if you clean the list and then restart VS, you will see no effect, because VS restored the list on the shutdown. So you need to close VS, clear the list, open VS.

like image 156
Alex Aza Avatar answered Oct 19 '22 08:10

Alex Aza