Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find all usages of a namespace and its members?

I am trying to search a large solution for any usages of a given namespace or its members, say, System.IO.

Resharper's Find Usages allows me to find references to System.IO, but only when used explicitly. If a file declares using System.IO; then uses any of the namespace's members without the full name, only the using reference is found. I need to find any usage of any member of the namespace in each file as well.

Can this be accomplished in Visual Studio, Resharper, or any other plugin do this search for me?

like image 912
dlras2 Avatar asked May 06 '13 19:05

dlras2


People also ask

How do you shorten a namespace in C#?

C# namespace aliasing The using keyword can be used to create an alias for a namespace. With nested namespaces, the fully qualified names might get long. We can shorten them by creating aliases. In the example, we create an alias for a Book class that is enclosed by two namespaces.

What is using system in C#?

The using System line means that you are using the System library in your project. Which gives you some useful classes and functions like Console class or the WriteLine function/method. The namespace ProjectName is something that identifies and encapsulates your code within that namespace. It's like package in Java.


1 Answers

Place cursor on keyword using of line using System.IO. Then you can use the normal Find Usages (Shift+F12). This works with ReSharper only.

like image 74
thersch Avatar answered Nov 01 '22 14:11

thersch