I would think neither.
Following are the reasons do NOT put the source code:
- developers might modify the code carelessly
- libraries usually subject to change
And following are the reasons DO include DLLs to the solution:
- makes deploying be more easily
- reduce the chances of using incompatible version of libraries
- reduce the chances of missing references
So, how to?
add a new Class Library
project with a unique name, say ClassLibrary1
, to the solution
in Build
page of its project settings, config Output path
to application output path
in Build Events
page, add the following line to Post-build event command line
block:
del "$(TargetPath)"
copy external DLLs to its folder and add them to references of ClassLibrary1
set Copy Local
to true
of all added references
set Project Dependancies
of other projects to it, check ClassLibrary1
add references of other projects, from the path the DLLs were put in ClassLibrary1
set Copy Local
of all these added DLLs in other projects to false
Thus, the project ClassLibrary1
be a central control of the external libraries of your solution. Everytime you Rebuild Solution
, ClassLibrary1
copies the latest DLLs added to its References
to the application output folder, and deletes the DLL it generated itself named ClassLibrary1.DLL
. And the application at either compile time or runtime would use the same version of DLLs, you don't need to do extra deploying or check for each deployment everytime you release your application.