Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know which other projects refer to a certain project in Visual Studio?

In Visual Studio, for a class, a field, a method, I can just right click and say "Find All References" to see who is calling my code.

But there is no similar thing for a project.

What is the simplest way to do so? Do I have to check every project to tell?

Edit: enter image description here

A refers to B, but can not find B using Regex.

like image 353
Cui Pengfei 崔鹏飞 Avatar asked Mar 06 '12 22:03

Cui Pengfei 崔鹏飞


People also ask

How do you check a project reference in Visual Studio?

Restart Visual Studio, create a new C# UWP app project, and then right-click on the project and choose Add Reference. Go to the Windows tab, then the Extensions sub-tab, and select the Extension SDK. Look at the right pane in the Reference Manager. If it has dependencies, they will be listed there.

How do I reference another project in Visual Studio code?

Right click on project --> Add Reference --> Select the reference project from the list.


2 Answers

  1. Find All (CTRL+SHIFT+F)
  2. "Find what:" = Reference.*ReplaceThisTextWithProjectName
  3. Check "Use:" -> "Regular Expression" in the "Find options" section
  4. "Look at these file types:" = "*.*proj* "
  5. "Look in:" = Select a directory/folder on your drive. Don't use "Entire Solution" it won't get to the project file itself. (Don't forget to check "Include sub-folders")
like image 55
fenone Avatar answered Sep 29 '22 03:09

fenone


Not sure if you've looked into using Resharper (not free), but it easily allows you to right-click on a project to see dependent code.

I can't live without and well worth the cost in my opinion - but it's not for everyone.

http://www.jetbrains.com/resharper/webhelp/Navigation_and_Search__Finding_Usages__Finding_Dependencies_and_Referenced_Code.html

There's a 30 day trial if you want to try it out - P.S I don't work for them, just a lover of the tool! :)

http://www.jetbrains.com/resharper/

like image 32
Craig MacGregor Avatar answered Sep 29 '22 03:09

Craig MacGregor