In my solution, I have a lot of projects which use project references to other projects in the solution. How do I figure out which projects reference a particular project?
5 Answers
A feature in Visual Studio exists for this. Right-click on your solution and click "Project Dependencies". Select the project that you want to find which other projects depend on it in the "Projects:" drop down list. Any projects that depend on the selected project will be unchecked and grayed out because checking them
would cause a circular dependency.
-
3That's not exactly the same, because that shows what *other* projects the one you have selected depends on. You would have to go through the list of projects, and see which ones have that project selected and compile the list yourself, where my solution shows you which projects depend on a certain project quickly. – Zack Jun 11 '15 at 16:45
-
2No, grayed out projects are those you cannot select to avoid a circular dependency (then they depend on it) – Adriano Repetti Jun 11 '15 at 16:49
-
The project dependencies doesn't show any greyed-out items for me, though there are some it won't let me select. Visual Studio 2015, tried both Dark and Light themes. :( – yoyo Nov 09 '16 at 18:02
If you want to find out which projects use Project A
as a project reference, the easiest way I've found is:
- Do a "Clean" on
Project A
- Unload
Project A
- Rebuild the solution
You can determine which projects use Project A
as a Project reference by examining which projects fail to build successfully at this point.

- 2,789
- 33
- 60
-
You should wait few minutes more before posting, maybe an easier solution exists... – Adriano Repetti Jun 11 '15 at 16:44
-
I used the Q & A feature for explicitly answering my own question. That doesn't mean I'll necessarily choose my own answer in the end. – Zack Jun 11 '15 at 16:47
-
@AdrianoRepetti Maybe you meant that it will not attract much attention since I immediately answered my question? – Zack Jun 11 '15 at 16:48
-
1Also. Self answers IMO will catch people seeking help more than people willing to answer. – Adriano Repetti Jun 11 '15 at 16:50
The best way I know is to use ... Notepad++'s feature "Find in files".
You just put the name of the project that you want to find in "Find what:" field, filter on "*.csproj" and search in folder that contains your repository.
It is very fast and lets you find projects that reference this project not only in one solution but also in other solutions in the same folder if you have any.

- 1,749
- 3
- 19
- 30
-
Nice suggestion! Visual Studio Code's text search can be used in the same way. – Wallace Kelly Dec 15 '20 at 19:24
Use the Code Map feature in Visual Studio, it will show you the dependencies between your projects. Right click on your solution, Show on Code Map.

- 1,690
- 12
- 14
-
I think this feature is only available in the Ultimate edition of Visual Studio. – Zack Jun 11 '15 at 16:49
-
This feature is only available for enterprise edition: https://learn.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2019#install-code-map-and-live-dependency-validation – Rzassar Oct 23 '20 at 13:21
If a solution contains lots of projects, and some projects reference other projects in your solution then you can determine project dependencies by checking the dll inside reference folder under the particular project.
For example,
- Suppose i have a solution named MyOwnProject.
- Now Inside 'MyOwnProject' solutions there are 3 projects named:
- A (Main startup project)
- B (Class library)
- C (Class library)
- Suppose A is the main startup UI project, and B and C are the class library projects.
- If project A calls some functions that are defined inside project B, then project A needs a reference to project B in the reference folder of the project.
- If a reference is missing when you build the solution, an error will show that points to function or method not found, because without a reference to project B, project A can't use any of the functions or methods of project B.
- By reading the errors you can get an idea of the missing references.
After building the solution, all the DLLs inside the reference folder with "Copy Local" set to true are copied to the output folder for the projects configuration.

- 2,789
- 33
- 60

- 3,446
- 25
- 36
-
I think "Reference folder" should be changed to "bin folder" when you are talking about running a project from within Visual Studio. – Zack Jun 11 '15 at 17:08
-
1yes it is bin folder but in the solution of visual studio reference is added to reference folder. After building the solution all the dlls inside reference is copied to bin folder in the project directory – Rashedul.Rubel Jun 11 '15 at 17:16
-
-
@Zack why is the minus voiting???? if the answer is satisfactory then please post a positive voting. – Rashedul.Rubel Jun 11 '15 at 19:04
-
Your answer is still not very clearly written. Also, you only need one space before the hyphen if you want to make a list, like " - " at the start of the line. That way people don't have to scroll a code box horizontally to read your answer, which is just annoying. – Zack Jun 11 '15 at 20:13
-
There is nothing unclear to me if anyone has enough knowledge on visual studio solution explorer – Rashedul.Rubel Jun 11 '15 at 20:31
-
1You can suggest to fix the format of answer instead of casting minus voting of a correct answer. because that will confuse others – Rashedul.Rubel Jun 12 '15 at 09:05
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/80400/discussion-between-zack-and-rashedul-rubel). – Zack Jun 12 '15 at 13:45
-