rui
rui

Reputation: 11284

Common Library: NuGet versus shared .csproj file. What's the best approach?

I have a fairly complex project that produces around 10 different executables. All these projects have a Common Library also developed by me for the purpose of sharing code between them. (think of it as being the root node of a dependency tree).

Because each of these 10 executables is fairly complex and has other specific libraries, I have actually around 4 or 5 different Visual Studio solutions to have the functionality a bit more contained and also to avoid mixing together completely unrelated executables.

I would like to know which of these two options is the best way to manage my Common Library project (how is the community doing this):

  1. Should it live in an internal NuGet repository and then all executable projects depend on it via NuGet?
  2. Should I keep having the same .csproj file for the Common Library used in the 5 different Visual Studio solutions?

I know there are pros and cons for each of these approaches. I would just like to know what people are doing out there.

Thanks, rui

Upvotes: 0

Views: 470

Answers (2)

Tigran
Tigran

Reputation: 62246

I would suggest the second solution as more maintainable and scalable in your case.

Nuget package one time installed is not changed unless you're not publish/build another one and remember to update your solutions.

This is not a case with the linked project. One time you fix a bug inside it or add new functionality you benefit at least from 2 aspects:

  • the changes are immediately visible in all your solutions
  • considering that they are different solutions you can easier understand if you broke something.

Upvotes: 2

Stefan
Stefan

Reputation: 17658

I would recommend the NuGet option.

It works much better if you are using different versions of your shared projects. i.e. You don't require to update all other projects immediately if the shared library is changed.

Upvotes: 2

Related Questions