Friday, January 21, 2011

Find in files with preview pane

A little over a year ago we moved from Visual Source Safe to Team Foundation Server. Over all I was very happy with TFS and all the new features. There was one feature that I greatly missed from VSS and that was the ability to search within all projects for some specific text. There was occasionally a time where I would come across something that I had done before and wanted to reference it before writing it again. This can easy be accomplished in windows using search. To enable searching on your project workspace you must first add it to the list of places that the window search indexes.

Open Control Panel and click on Indexing Options.

image

Click on Modify and select the folders that you want indexed.

image

You will also need to click on advanced and select the “Index Properties and File Contents” option.

image

*Changing this option will reset the index and you will lose the ability to search items until they are re-indexed.

Now when performing a search all my project files are included.

image

Windows 7 does not have the ability to show a preview of C-Sharp files by default.

image

Adding this functionality is easy using the Managed Preview Handler Framework. Stephen Toub has a great walk through on this here. There is a CodePlex project that wraps his work along with a few others into an easy installer here. After either registering your own handlers or installing the CodePlex project you can use the windows preview pane to see the files from your search results.

image

No comments:

Post a Comment