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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With