简体   繁体   中英

.NET Intellisense: 2 projects in one solution

I have created a solution file consisting of these 2 projects: ProjectA and ProjectB (main). How can I get Visual Studio's Intellisense to work across the two projects?

For example:

ProjectA has ClassA with MethodA . While working on ProjectB , how do I get Intellisense to detect MethodA and any documentation on it without a build/rebuild of ProjectA ?

You need to add a Project A as a project reference in Project B using the projects tab of the Add Reference dialog.

This will cause Visual Studio to read Project from the project system rather than the compiled DLL. This offers a number of advantages:

  • You won't need to rebuild it
  • Visual Studio will realize that there is a dependency and automatically build project A when building project B
  • Editor features like Go to definition will work.

In the event that you already have a reference (and the Intellisense is still not showing up), this probably means you are referring to a dll already. You will have to remove the reference and add it again via the Add Reference dialog as mentioned above, or it will tell you that it already has that reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM