1

We have a few projects in my organization that are being developed in parallel and I have found that they are increasingly using similar Utility/Logging/Etc functionalities that they have as separate projects. Having heard about Git Submodules in the past, I figured that this would be the perfect time to set this up. This is when I ran into problems.

Projects that I would like to extract as re-usable sub-modules:

  • Utility (collection of helper classes, utilities, etc)
  • Log (log4net wrapper with extra functionality)
  • Possibly others

The biggest problem experienced is Nuget packages not resolving. They resolve in sub-modules individually, but not when they are used inside other projects. The second problem is confusion around how to reference those sub-module projects in the main project - currently I have added them in as an existing project, pointing into the SubModuleSolutionFolder/ProjectFolder, which seems... dirty :/

I have tried looking around for some examples/tutorials/articles that describe the correct usage of sub-modules in Visual Studio projects, but was unable to find anything decent. The only other thing that I have found is a few replies recommendations to use Nuget/Nuget-like tools to set up packages for those projects to use in other solutions, but this seems like an overkill to me for a few simple libraries. Is it worth doing?

Any pointers/links/best practices would be highly appreciated!

  • 1
    You're mainly asking about sub modules, so I won't answer, but you can set up a NuGet package feed on a shared network drive in about 20 minutes. It's not much more complicated to set up a full blown private NuGet server. We started with a network drive a year ago and have only recently felt the need to spin up an actual server. Works for us, YMMV. docs.nuget.org/create/hosting-your-own-nuget-feeds – RubberDuck Sep 19 '16 at 9:50
  • Thanks for the reply! After a bunch more head-scratching that is the path I decided to take. Currently getting a server set up while going through the NuGet doco - it really does seem simple enough. Will get an automated build script creating NuGet packages for the desired packages and deploying them to the server automatically, which should mean pain free deployment of any changes. :D Reading more and more on submodules, it sounded more and more painful in the long run with a lot of people recommending against that if possible – Ross Sep 20 '16 at 0:40
  • You may also want to consider ProGet, which has a free edition. It's a lot faster and is more feature complete than the NuGet.Server library or a network share. Especially in CI scenario's those other solutions can get very, very slow. inedo.com/proget – jessehouwing Sep 25 '16 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.