Adding references to other projects in Visual Studio 2012

北战南征 提交于 2019-12-17 20:25:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!