In Windows 7 and Windows Server 2008 Windows Search can be a powerful feature for developers. It enables you to search with a full-text index over your whole code repository. Once configured correctly, it can help a lot when searching things in code.
How can you use Windows Search?
Windows Search fits very well in Windows Explorer. If you use the search there Windows Search will be requested for results. As result you will not only get file names, although you can search for content in the file for registered and indexed file extensions.
Why Visual Studio’s Find in Files is not enough?
Visual Studio provides a very comfortable and powerful “Find in Files” feature. If you just have a few code files to search that will be enough for you. On the other hand searching gigs of code is too much time consuming. Windows Search is able to deliver search results with content search in just a second!
Configuring Windows Search
- Start / Control Panel / Indexing Options
- Choose the locations you want to index. Add you code library folders here
- Click to Advanced / File Types
- Configure all extensions you want and enable content search
A List of File Extensions
Here is a list of extensions you should consider.
asax, .ascx, .ashx, .asmx, .aspx, .bat, .c, .cd, .cmd, .config, .cpp, .cs, .cshtml, .csproj, .css, .csv, .datasource, .deploy, .disco, .htm, .html, .manifest, .rdlc, .resx, .settings, .sln, .svc, .svcmap, .testrunconfig, .tt, .ttinclude, .vb, .vbhtml, .vbproj, .vdproj, .vsto, .wsdl, .xaml, .xbap, .xhtml, .xss
Search Expressions Examples
Here are some examples search expressions that can be useful developers.
- test.cs AND *.csproj
Shows all project files that contain the file test.cs
- mysample.csproj AND *.sln
Shows all solutions that contain the project mysample.csproj
- Save As
Shows all files (for example .resx) that contain the text “Save As”.