References can be added in two ways in a project.
But, When to use Project and when to use File reference?
A reference project is a write-protected copy of a project at a particular time.
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 .
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.
You didn't specify but I'm guessing you're referring to Visual Studio?
The main difference between a project reference and a file reference is whether or not live updates are available. In a project reference you will be able to see the effects of edits in one project immediately in the other project via items like Intellisense. So if you for instance add class named Foo, this this type will show up in intellisense immediately in any project which has a project reference on that project.
File references on the other hand can only see changes that are present on disk. A compilation must be performed and bits written to disk in order to see the changes.
In general, it's best to use a project reference.
Another angle that needs to be considered is the relative languages of the projects. Project to Project references are maximally useful if the language in both projects are the same. If the languages are different they tend to be treated more like file references than project references.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With