Where to store external dll files?

In my project, I use some third-party libraries. I turn them on using the links folder in Visual Studio.

But where should I save the dll files? They refer to the path in the file system, but it would be nice if I could include it in the project. But how?

+48
c # dll visual-studio wpf
Nov 25 '10 at 13:23
source share
8 answers

This is what I do:

  • Create a lib folder at the solution level
  • Download and copy all my third-party DLL files there
  • Link from lib folder
  • Put all these DLL files in the source control. I use Subversion and I add them manually, but this is one-time.

You can also add a solutions folder and add them there.




UPDATE 2012-12-19

The answer above was when NuGet was in its infancy. FWIW, my approach when we have NuGet elements:

  • Do as described above for simple DLL files (where they do not have the NuGet pkg package)
  • Enable Package Recovery for solution
  • Modify the packages.config file, if necessary, to block the version for a specific package.
  • Do not store the package itself in the version control system (set ignore for Git , Mercurial , etc.)

I really use NuGet to manage even internal dependencies and has its own feed.

+60
Nov 25 '10 at 13:26
source share

As a rule, the structure of my projects looks at least (at least):

 projectname - trunk - src - lib - support - docs - releases 

The trunk folder contains a copy of the source I'm working on now. In addition, there is a "lib" directory that contains all the third-party assemblies referenced by my project.
(I refer to assemblies in this position).

The 'releases' folder contains the branches of the chest. For example, when v1 is released, the branch is taken from the trunk, so I have a copy of the source code and all its dependencies needed to build version 1 of the application. (This is convenient for corrections. Correct the error in this branch, merge the correction into a tube, rebuild this branch, and you have a fixed v1 of your application).

All this goes into the initial control. (Yes, referenced assemblies as well). Thus, it is very easy if another colleague must also work on the project. He just gets the latest version from source control, and he (or she) has everything in its place to be able to compile and build).

(Note that this is also true if you use something like CruiseControl for continuous integration ).

+9
Nov 25 '10 at 13:26
source share

You should see NuGet . This is a package management extension for Visual Studio 2010 designed specifically for what you want.

+4
Nov 25 '10 at 13:26
source share

In the Visual Studio properties window for the link to the dll there is the Copy Local property - set this to true and they will be copied to the local bin directory of the project

+4
Nov 25 '10 at 13:26
source share

Check out NuGet (package manager for Visual Studio) ...

NuGet is a Visual Studio extension that simplifies the installation and upgrade of open source libraries and tools in Visual Studio.

Then read this NuGet doc to get crème de la crème :

Using NuGet Without Transferring Packages To Source

+4
Feb 08 '12 at 4:22
source share

Take a look at Tree Surgeon - creating a development tree for a .NET project, which can be a good starting point, and from there you can improvise.

+2
Nov 25 '10 at 13:30
source share

Personally, I have a folder in my source element for third-party DLLs (with a folder for each company, organization) and link to them from there.

These files are then available to all developers who download the source and can be easily updated.

+1
Nov 25 '10 at 13:28
source share

To answer this correctly, you need to distinguish between the environment and the working set .

Environment:

  • These are all the tools and libraries needed to create your solution.
  • Environmental events are expected to remain constant.
  • Things in the environment are usually versioned, and you should have several versions side by side.
  • Things in the environment are usually licensed.
  • The medium is not under source control.
  • A good example is Visual Studio.

Work Set:

  • This is basically your source code.
  • These are all the requirements needed to get the final executable.
  • You shuold expect the working set to change a lot during development.
  • The working set must be controlled by the source.

You need to decide in which category your component fits.

+1
Nov 25 '10 at 13:50
source share



All Articles