问题
I have a solution with 4 projects in it.
Test.Common Test.Controller (Controllers for the Web project) Test.Data (EntityFramework) Test.Web (MVC4)
When I go to add a reference to my Data layer to my Controller project and browse to my Data project's directory, should I be using the dll from the 'bin/Debug' directory or the 'obj' directory? And, does it make a difference?
回答1:
Neither.
You should add a Project reference (from the Solution section)
This will make Visual Studio resolve the reference from the project system, making features like Go to Definition and automatic rebuild work.
Outside your solution, you should add from bin.
回答2:
You should be adding a reference to the Project in question, not its output. There is a 'Projects' tab on the 'Add Reference' dialog.
回答3:
If the project is in your current solution you can make a reference to the project (Class Library) itself. This will offload the responsibility of configuration management (Debug, Release, etc) to Visual Studio.
来源:https://stackoverflow.com/questions/16927242/adding-references-to-other-projects-in-visual-studio-2012