Best way to add project references to another project ???

Hello,

I would like to know what's the  best way to add references to a project.


Example :

I've two 2 projects ...

   * Data Connection Project
   * Customer Project

The customer project must have access to the functions of the data connection project. For this, I've to add to data connection references to the customer project. What is the best way to add such references? Do I've to add the complete existing project to my customer solution? Or am I better to add only the dll who is located into the bin folder of my data connection project? What are differences between the two? I also want to be able to debug easily.

Last question... If my data connection also has a reference to another project like a global class (sql functionalities) do I've to add the complete solution (*.sln) to my customer class or only the project (so that all the including projects are references as well) ???


Thanks a lot for your help !!!!


davyberrohoAsked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
If you add the reference from the solution level, then you have access to the code when running and you need to debug on the development machine.  When you build the solution and the project for the main executable, the compiler will create a DLL reference for you.

Bob
0
 
davyberrohoAuthor Commented:
Thanks a lot for your fast answer !

I've another question....
Is it normal that, once I've add the existing solution to my project, I still have to add a project-reference? (My Project --> references tab --> add references --> projects and then I've to choose the added project.) otherwise it cannot find the referenced project ???


Thanks a lot.

0
 
Bob LearnedCommented:
Yes, that is normal.  That is the nice part about project references.  It allows access to the code in the DLL project, and creates a reference binding when deploying it.

Bob
0
 
davyberrohoAuthor Commented:
Thanks a lot Bob !!!


You certainly earn the 500 points ! ;-)



Thanks again!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.