visual-studio - these - visual studio search exclude file types




Visual Studio 2015 Find in Files not remembering file types or locations (3)

I rely on the Find in Files dialog in Visual Studio a great deal. (Sometimes Intellisense/Resharper just don't cut it.) Since upgrading to 2015, I've noticed that the dialog doesn't remember my custom "Look in" paths or "Look at these file types" lists between sessions.

If I close my solution and VS instance, then reopen, I have to enter my custom path and file types again. Huge waste of time. Has anyone run else run into this? Any workaround? 2013 used to remember this stuff.

Microsoft Visual Studio Professional 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00081
Installed Version: Professional

I ran into this today. After much searching I found a post on the visual studio forums somehow. This pointed me towards ReSharper. This directed me towards a workaround.

  1. Start visual studio in safe mode with the command line argument /SafeMode
  2. Create the folder sets you want for searching
  3. Restart visual studio not in safemode

Once I had restarted all my created custom searches remained, and the registry values were created. This might not work in the specific case, but this worked for me.


I've never had any problems with it not remembering my settings, but I imagine that you could run a custom registry modifier to add the appropriate keys, you could make sure your settings are always pristine. The custom search information is stored in HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\Find.

The file types are stored in a string key called Filter with whatever you would normally input into the custom file type category in the VS search window. For example searching for only .cs and .txt files you would put *.cs;*.txt.

The folders are located in a string key called Query with values such as C:\Folder1;C:\Folder2. However, it's behavior seems a little weird. You have change the value of Query and a Query+integer value (i.e. Query0) to the same value to have it appear in Visual Studio.

If you just run a script to modify the above values to the files types/folder locations you want, that should work.


You can set these values programmatically inside Visual Studio for the Find and Replace dialog (for example with Visual Commander):

DTE.Find.FilesOfType = "*.txt";
DTE.Find.SearchPath = @"c:\temp";




visual-studio-2015