'How to exclude *.desginer.* documents from filtered search in Visual Studio 2022?

This question is about the filter in Visual Studio (2022), reachable by CTRL + T.
(It is not about the Search with CTRL + F)

If I don't want to see all the automatically generated entries in *.designer.* documents using the filter function, how can I exclude them?

I know that I can use the scope restriction in the upper right corner of the filter box 2 to "Search current document only". But I would like to search my entire project and exclude only the mentioned *.designer.* documents.

Is there any setting for this filter restriction?
Or do you know any workaround to see only useful filter locations?



Solution 1:[1]

Below patter works for me VS2022.

*.aspx;*.ascx;*.cshtml;*.cs;!*.designer.cs;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1