Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project reference vs. DLL Reference - Which is better?

I know there are other questions regarding this subject, and I've looked at this question, but I'd like to see a little bit more discussion and information on both sides of this - is it a better practice to add a project to a solution and reference the project, or to add a reference to the .dll?

like image 926
Zann Anderson Avatar asked Jun 15 '10 18:06

Zann Anderson


People also ask

What does project reference mean?

A project reference is a link from the current Studio project to another project. The reference makes certain resources in the referenced project become available for use in the current project.

What is project reference in Visual Studio?

A reference is essentially an entry in a project file that contains the information that Visual Studio needs to locate the component or the service.

Can two projects reference each other?

This can be achieved by adding reference of one project in the other project. If both the projects are in the same solution, then expand the project name, right click on 'References', click on Add references. Go to 'Projects' Tab, select the project name which you want to use in current project, click ok.

What is the difference between Dependencies and references in Visual Studio?

They are basically no different, they are used to store and manage references. Just as Lex said, the Dependencies is a better way to represent different types of references, we can clearly know where the reference comes from, SDK, nuget, etc. so that we can manage our references more efficiently.


1 Answers

It's not much of a choice. If you have a solution with both projects then use a project reference. If your solution doesn't have the project then you have to use an assembly reference.

So the real question should probably be: do I create a solution with both projects? Yes, as long as the project is still in the debug stage and liable to require bug fixes.

like image 54
Hans Passant Avatar answered Sep 19 '22 22:09

Hans Passant