Often when I want to search through my code in Visual Studio, I know the thing I\'m looking for is in some C# code. However, as I\'ve used the same variable name in a JavaSc
Instead of Ctrl + F
, I think it is Ctrl + Shift + F
which gives you the choice to specify file types, you wish to look into.
In the Find dialog box, go to "find options->Look at these file types".
Type in you own string, eg, *.cs, *.aspx, *.ascx
. The click the "find all" button.
In the Find in Files dialog (Ctrl+Shift+F), there should be a field called Find Options. You should be able to enter the extensions of fields you want to search in a field in this dialog:
*.cs; *.aspx; *.ascx;
Another way to limit file searches is by only choosing certain folder sets.
You can choose file types from default or type your own. Regular expressions available for complex search.
I like to exclude js files by using the following search:
*.a*;*.cs*;
Most of the times, I end up searching for stuff in aspx, cs, cshtml files so this is quite helpful.
Notice how I use *.cs*
instead of *.c*
since the latter would select jquery custom files such as jquery.custom1234.js (which I usually use in most of my projects), of course if you don't you could just use *.c*
.