Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all references of a dll in a project

In Visual Studio 2010 (or 2012) is there a way to locate all references in code that mention any class/method defined in a referenced dll.

Currently I have two processes that I use (depending on the situation):

  • The first one involves just deleting the dll reference from the project and then making a note of all the build error locations.
  • The other way is to open the reference in the Object Browser and then expand to it's namespaces, and for each namespace I do a manual search, but this doesn't always help find all references and because the legacy code has the same namespaces spanning multiple assemblies there's a lot of noise to filter through.

Neither of these are really ideal solutions, is there any easier way to do this? perhaps via a VS extension.

like image 398
Seph Avatar asked Jun 16 '13 07:06

Seph


People also ask

Where can I find DLL in project?

Select the C/C++ DLL project in Solution Explorer and select the Properties icon, or right-click the project and select Properties. At the top of the Properties pane, under Configuration, select All Configurations.

Can you see source code of DLL?

You cannot get the exact code, but you can get a decompiled version of it. The most popular (and best) tool is Reflector, but there are also other . Net decompilers (such as Dis#). You can also decompile the IL using ILDASM, which comes bundled with the .


2 Answers

You can find this if you install Resharper:

Expand the References and choose Find code Dependent on Module

enter image description here

The results then appear like:

enter image description here

like image 83
wal Avatar answered Sep 27 '22 20:09

wal


Don't have Resharper, but you do have Sublime Text?

in Sublime Text, select 'open folder', and select the folder containing the solution. Then select menu item Find -> Find in Files...

In the 'Where:' field, enter:

*.scsproj

Then in the 'Find:' field, search for the string

Include="[full namespaced name of library]"

for example:

Include="System.Xml.Linq"

will find all projects that reference the System.Xml.Linq dll in the solution.

like image 25
Alex Fairchild Avatar answered Sep 27 '22 21:09

Alex Fairchild