Reputation: 385
I have around 100 projects in my .NET solution. I managed to get all the nuget packages used in the projects through Package manager console using a simple command.
I have around 100 Nuget packages . Now for every nuget package I want the projects that are having it as a reference. i.e Suppose I have three projects A,B and C and I have Nuget package suppose nHibernate.
Manually when I go to references section of each project I see nHibernate is referenced in Project A and Project B. So my dependent project for that package is A and B.
Like this I want for all my nuget packages. How can I do this without any manual task. Like is there any command or way I can use.
Upvotes: 0
Views: 2310
Reputation: 818
If you are using Visual Studio Enterprise you will have Microsoft Architecture Diagrams and Analysis Tools installed.
Architecture
then select Generate Code Map For Solution
Externals
New Graph From Selection
Show Assemblies Referencing This
You can also do this for multiple packages to view all the dependencies of all packages you selected. On step 3 just select multiple packages with CTRL pressed and follow the same steps.
Upvotes: 5
Reputation: 4138
There may be a number of options you may have:
packages.config
using search in filesMultiValueDictionary
with the package as the key and the values the projects that has that package.Going with option 2 gives you the most flexibility if you/your team has the time to write it. This may be useful in a build pipeline to check for dependencies and alert if there are inconsistencies, for example.
Upvotes: 1