I've already extensively searched for a solution, tried different approaches but none worked, thus I'm asking here.
My current need is to have separate Git repositories each containing a .Net solution file with related projects. One or more of those repositories will contain only class libraries and I need to use those libraries inside other repositories solutions.
My first though was to use Git Submodules to avoid ugly copy-paste and still have the source code of the class libraries available when developing the applications.
So my attempt was to include the submodule, then in my current Solution do "add existing project" and load the desired class library(ies).
The huge problem I've been unable to overcome is Nuget package restore. The imported projects reference libraries in "..\Packages*" but when imported as submodule they are located in an additional subfolder so they can't find the required dependencies:
- MySolution.sln
- Packages folder
- MyAppProject folder
- Submodule folder
-- EXPECTED packages folder for MyLibraryProject that I cannot generate
-- MyLibraryProject folder
One solution I found and tried was this but it has two major problems:
- It's supposed to work using MsBuild package restore and I absolutely don't want to use it
- Even trying to use MsBuild package restore it didn't work at all, I still have a single Packages folder in my current solution folder. Maybe I did something wrong but again, I don't want to use MsBuild approach.
Now I'd really like to know if there's a clean way to solve this problem, or if the only thing I can do is to give up having libraries source code available in my application solutions and publish my libraries on a private NuGet feed and reference them from there.
Thanks.