Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are Visual Studio project references?

I came across the Framework and References tab of my project and noticed that I can "Add New Reference..." to my project, what is this functionality?

like image 749
James Linden Avatar asked Nov 14 '11 00:11

James Linden


People also ask

What does a project reference do?

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.

How do I get references in Visual Studio?

The Find All References command is available on the context (right-click) menu of the element you want to find references to. Or, if you are a keyboard user, press Shift + F12. The results appear in a tool window named <element> references, where element is the name of the item you are searching for.

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

They are basically no different, they are used to store and manage references.

What is the difference between project reference and DLL reference?

If you directly add a DLL then you are locked into whatever that particular DLL was built as. The project reference allows this to be a build time decision. This is correct what you are saying. At the same time it is not causing issues when working with .


1 Answers

References are used to pull additional libraries into your project. For example, when you're creating a Windows project, you'll be using Windows forms, XML parsers, socket libraries, and lots of other useful stuff. Now, you could create all these from scratch, but that would be an insane undertaking. Instead, you can use libraries which have been pre-built, such as System.Windows.Forms (all the form stuff), System.Xml (XML parser stuff) and others.

Down at the low level, these are all DLL files precompiled by Microsoft and distributed along with Visual Studio. Add Reference allows you to add new ones of these to your project, for example, Managed DirectX for 3D isn't something which is commonly used, so must be manually added to a project.

I've also just noticed the C++ tag on this, so this may actually sound very patronising (as I may have gotten the scope of the question wrong), in which case, I didn't mean it. For C++, it will be used for C++/CLI, which is Microsoft's attempt to allow C++ to use the .NET framework.

like image 141
slugonamission Avatar answered Sep 22 '22 09:09

slugonamission