5

What is the best practice for managing references in a .NET open source project? I'm writing a small library that will use Json.NET. Should I check the Json.NET DLL straight into source control?

3 Answers 3

3

Yes you should - either that or reference the original project's version control directly (ie use SVN's externals feature to grab the relevant revision from the source repo, or have a link to get the right version of the project's source).

Put the dll in a slightly separate part of your repo though - do not bundle it in your /bin/release directory, you'll find it much easier to work with 3rd party dlls if there is a clear distinction between what is your code and what is theirs - especially when you come to replace or modify it.

1
  • Most of the open source projects I've looked at have both a /src and a /lib or /contrib in the root. References obviously go in the latter.
    – Aaronaught
    Sep 7, 2011 at 23:23
2

heres what I do: I create a solution folder for my 3rd party assemblies, I then add them to the source control and check them in. this way, they are distributed with my project. Of course, this is all subject to the distribution licenses of the various 3rd party assemblies.

I hate it when I dl an Open Source project and then I have to go and hunt down assemblies--especially when those assemblies may no longer be available.

2

If the licensing allows for including the binaries in your source control and distributing them, it makes alot of sense to include them for a few reasons. First and foremost is ease of development on you -- you don't need to go track down a dependency every time you want to hack on a different machine. Second is ease of development on folks also hacking on your library -- they won't have to go through the same gymnastics. Finally and perhaps more important, it makes sure you've got the correct version of the library traveling with your code.

In the case of JSON.NET, I believe it is MIT licensed which means you can definitely do it from a legal perspective. Add away. Preferably via nuget so I don't have to download it twice if I don't need it.

1
  • +1 for NuGet. NuGet helps a ton with managing dependencies amongst open source projects. For example, if someone wants to use your library which uses Json.NET and another library which also uses Json.NET, NuGet will resolve versioning issues and make sure that references for both libraries are correctly resolved. Sep 8, 2011 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.