Angelo Lee's Blog
This is my kingdom .If i don't fight for it ,who will ?

Add Project Reference vs Add DLL Reference


First one is - Right click on project << Add Reference << Select Project in Project tab

Second one is - Right click on project << Add Reference << Select DLL in Browse tab


The correct way to do it is to add a project reference.
one of the most important differences is that a project reference is updated automatically when you change the referenced project.

for example- If you change your DAL method from GetEmployees() to GetAllEmployees() then you can use GetAllEmployees() immediately in your BL class, without compiling your DAL first. 


You typically use the project reference when the reference is part of your solution. In this way the relevant latest code is always used.

You will reference an assembly when it is a third party component or not part of your solution. This is somewhat more static as you will be using the code at the version represented by the assembly. So any changes to the assembly will require you to physically overwrite the referenced assembly with the updated dll.




posted on 2011-09-14 10:10  Angelo Lee  阅读(218)  评论(0编辑  收藏  举报