Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would think <strong>neither</strong>. </p> <p>Following are the reasons do <strong>NOT</strong> put the source code:</p> <ul> <li>developers might modify the code carelessly</li> <li>libraries usually subject to change</li> </ul> <p>And following are the reasons <strong>DO</strong> include DLLs to the solution:</p> <ul> <li>makes deploying be more easily</li> <li>reduce the chances of using incompatible version of libraries</li> <li>reduce the chances of missing references</li> </ul> <p>So, how to?</p> <ol> <li><p>add a new <code>Class Library</code> project with a unique name, say <code>ClassLibrary1</code>, to the solution</p></li> <li><p>in <code>Build</code> page of its project settings, config <code>Output path</code> to application output path</p></li> <li><p>in <code>Build Events</code> page, add the following line to <code>Post-build event command line</code> block:</p> <pre><code>del "$(TargetPath)" </code></pre></li> <li><p>copy external DLLs to its folder and add them to references of <code>ClassLibrary1</code></p></li> <li><p>set <code>Copy Local</code> to <code>true</code> of all added references</p></li> <li><p>set <code>Project Dependancies</code> of other projects to it, check <code>ClassLibrary1</code></p></li> <li><p>add references of other projects, from the path the DLLs were put in <code>ClassLibrary1</code></p></li> <li><p>set <code>Copy Local</code> of all these added DLLs in other projects to <code>false</code></p></li> </ol> <p>Thus, the project <code>ClassLibrary1</code> be a central control of the external libraries of your solution. Everytime you <code>Rebuild Solution</code>, <code>ClassLibrary1</code> copies the latest DLLs added to its <code>References</code> to the application output folder, and deletes the DLL it generated itself named <code>ClassLibrary1.DLL</code>. 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. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload