Changing the Search Scope to find and replaces external files easily in Visual Studio ?

Changing the Search Scope to find and replaces external files easily in Visual Studio ?

You can change the scope of the search boundary for your Find and replace dialog control inside Visual Studio. And again, this is very  common feature of Visual Studio and it’s there since beginning. But I often observed many developers are not using it and just spending a lot of time in searching files. Well, if the files exists within the solutions it is ok, but think of it you are referring some other third party components, or you have multiple solution to work with or you have some external code base. You can solve this very easily by creating custom Look in for search inside Visual Studio.

When you open the Find and Replace dialog window, by default you will find the search scoped is limited to “Entire Solution” .

image

In case you want to search in to a specific project, current project, current document etc. and here is the limit. You have specific set of search scope to look into.

However, you can change the “Look in:” values. If you want to search something outside the solution.  You can configure the folder as shown here.

Select the “…” button to bring the “Choose Search Folders” options.

image

Once you have the “Choose Search Folders” dialog open you can configure the folder set with your required folders.  This could be a single folder or multiple folders.

image

You can also include your solution folders with in it for a single reference of search.  Once done, click on “Apply” and “Ok” .

Now you will fund the given “Folder set” name in the “Look in:” dropdown.

image

Now you can search for that scoped items as well.

This is really helpful and save lot of time for your to find files. You can take help of Visual Studio to do this job as well.

Hope this helps !

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.