Limit search to specified Folders or File Types in Visual Studio?

后端 未结 6 1898
说谎
说谎 2021-02-04 23:07

Is there a way to limit a search (via the \"Find and Replace\" dialog) in Visual Studio to specified folders or file types?

6条回答
  •  星月不相逢
    2021-02-04 23:33

    Fastest folder search in VS:

    As said in other answers, there is no immediate way to limit your search to a given folder within the current solution. (There are at least 3 feature requests for this in visualstudio.uservoice.com that have all been closed for lack of upvotes.)

    But here is the fastest workaround that I could find.
    Works without leaving VS and with keystrokes only (no mouse action required):

    • In Solution Explorer select the folder to search within.
    • Press Ctrl-C (copies folder path to clipboard).
    • Press Ctrl-Shift-F to open "Find in Files".
    • Enter your search term, then press Tab to forward the cursor to the "Look in" field.
    • Press Ctrl-V to paste in the folder path from clipboard.

提交回复
热议问题