Where do you put your 3rd party libraries?

后端 未结 7 1594
悲哀的现实
悲哀的现实 2021-02-05 05:38

I\'ve got a bunch of .dll assemblies, such as HtmlAgilityPack and MoreLinq. Where am I supposed to put these files? I usually toss them so

相关标签:
7条回答
  • 2021-02-05 05:46

    In a folder UNDER your solution directory, e.g. "external" or "library". That way your continuous integration system (or other team members) can do a pull of one root from your source control system and have everything they need.

    In SVN, use svn:externals to pull that directory from a different root so you can easily share library DLLS (and library projects) between solutions.

    0 讨论(0)
  • 2021-02-05 06:00

    Having a "Lib" folder at the same level as source projects is a common way.

    To be honest, it's not the dependencies my projects have that I find hard to manage, it's the dependencies the dependencies have. I'd just like to mention NHibernate, Castle Windsor and the various Castle Windsor Facilities in particular. Getting all of those to play together on my last project cost me a lot of time.

    For open source projects, I also like to have the source code handy because sometimes its useful to debug into the source code. (And sometimes because the documentation is so poor, you have to read the source code to find out how it works). I've seen VS projects arranged so that the project references the DLL yet at the same time, VS knows where to find the source code, as I write I can't quite remember how to do that.

    So, a Lib folder for DLLs works for me; I often call it "Shared Dependencies".

    As for open-source source code, I don't have a standard way to version that because each project is structured differently and has a different build process. I don't like to tinker with the open-source project structure or build method because then, I take responsibility for it. If for some reason, it won't build, or builds incorrectly, or produces a faulty DLL, the cause would be exceedingly difficult to track down, and I'd have to get deep into troubleshooting all of that which I dont care about at all.

    0 讨论(0)
  • 2021-02-05 06:00

    At my company we place all our shared DLL assemblies onto a network drive in a folder called Assemblies. From there, we use SyncToy to mirror changes between that folder and a folder on our local development machines (in my case C:\Assemblies with subfolders for different versions or useful third party assemblies). Using the "Reference Paths" feature of Visual Studio projects makes it very easy to select different assembly versions based only on locations.

    For projects at home, I would definitely go with the idea mentioned by Jeff M of placing them in the Visual Studio folder under My Documents.

    0 讨论(0)
  • 2021-02-05 06:03

    There's no standard place to put them, but make sure you:

    • Put them in one place
    • Include them in source control.

    I put all my required dll's in a top level directory in my solution called "Dependencies", parallel to the project folders. I have them in source control such that when new developers check out the solution, it all compiles and works right off. It's the only way to go.

    I include only the .dll files absolutely needed. This keeps it light, which is good, but then when I find some other part of MVC Contrib or whatever that I need, I have to go find the unzipped directory, which might not even be on my computer! Others put entire library directories (readme.txt and all) as part of their source control linked to the solution. This ensures you and future developers will have everything they need, but adds a little dead weight. Either is a good strategy.

    0 讨论(0)
  • 2021-02-05 06:03

    In the office we have a share on the network for referenced asseblies. These could be 3rd party or assemblies of our own that could be shared between projects.

    I also, don't like the idea of putting the dll files in source control. If all the developers have access to the share all will work fine.

    0 讨论(0)
  • 2021-02-05 06:04

    I don't have a hard and fast rule on the location. However, I would encourage consistency!

    For example, I needed to to this for a small tool I'm writing for a client at the moment, so I checked their other code bases in Bitbucket which seemed to use a dependencies folder in the solution folder (alongside the other projects), so I copied that.

    0 讨论(0)
提交回复
热议问题