Click here to Skip to main content
15,920,688 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have different modules in our project. Each module implemented as separate solution. There are 40+ solution in the project. I am making a change to one method in one solution eg. Enctypt() method. It is a overloaded method and it is being used in many places in different solutions. I want to find out all the places where this method is referenced.

Is there a best way / any tool available to find all the references to a method in different solutions.

What I have tried:

I tried to search for Encrypt() method in all the solutions but it returned thousands of results. because there are method with same name available in other solutions also, hens it is returning many results.

I tried to search with namespace and class name also.

your valuable suggestion will be very helpful to me. Thanks.
Posted
Updated 20-Oct-16 0:11am

I think you are confusing "Solution" and "Project" - Visual Studio loads a single Solution, which can consists of multiple Projects: each Project generates a separate Assembly.
Within a Solution, you can go to the definition of a method, right click it's name, and select "Find All References" to get a complete list of everywhere it is used within the Solution.

If however, this is multiple Solutions, then there is AFAIK no built in method to locate all references in all Solutions of a single method - if only because Projects with use References to an Assembly (rather than a Project) do not have any back-links to the Assembly source.
 
Share this answer
 
Hi naveen_g

How you ever keep things together if you organize your solutions like this, I wonder?
What I do: Only work with project references inside solutions, no assembly-references to your own projects.
Then I group the projects together in the solutions I need them (it's perfectly valid to have a project take part in different solutions).
Then layer/group your solutions - Kind of "staging" for references (e.g. I use Shared, Service, Client, Data, Hardware, Gateway) so that the least possible project-overlap is created.
-> And problems like yours should be very seldom...

Then if you have a build-system in place and use CI you will find out on validation-build you broke one of the staged (then assembly-referenced) solutions (all solution concerned should be build by your builddefinition of course).

But I have to confess it was a long and painfull way to organize everything like that and find a nice workflow that everyone can keep up with...

So maybe a simpler solution could be (depends how many projects you really have) make one big 'dummy' solution for all your projects (this one will be just for cases like you have now, just don't forget to add new projects there also, if you create new solutions or add projects to existing ones later.

Kind regards

Johannes
 
Share this answer
 
Load all projects into one solution and have them reference each other by project reference. If that's not possible\too much effort, download a tool called IL Spy, load all your assemblies into it and use its "Analyze" feature to show you what methods call what.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900