0

I have a file that contains generated code which is rarely of interest when I search using Find In Files in the Current Project in Visual Studio. I'd like to have this file excluded from search, but still need it fully integrated into the project's build, including for output creation and IntelliSense.

Moving the file to its own project so that it gets its own DLL would work. Is there a lighter weight approach that works within the existing project?

Edward Brey
  • 40,302
  • 20
  • 199
  • 253
  • related and dated: https://stackoverflow.com/questions/1596337/how-to-exclude-designer-cs-from-visual-studio-file-search – Daniel A. White Jul 24 '17 at 11:16
  • @DanielA.White That question is on filtering at the time of search. Unfortunately, it doesn't have any answers I'm happy with. This question approaches the problem from a different angle. – Edward Brey Jul 24 '17 at 15:27

1 Answers1

0

Is there a lighter weight approach that works within the existing project?

If I understand you correctly, one possible way I could think of is Look at these file types field present in Find and Replace (Shortcut: Ctrl + Shift + F). You could specify the file types with extensions or/and names. You could use multiple names separated by a semicolon. If there are other files of the same type of this file, this method will be ineffective.

Then you can try to use "Exclude From Project" option when you use Find In Files in the Current Project, after searching, click "Show All Files", then select "Include In project".

enter image description here

enter image description here

Besides, you can vote for the feature in Visual Studio:Add "exclude files" to the "Look in" options under Find and Replace

Leo Liu
  • 71,098
  • 10
  • 114
  • 135