添加git子模块作为VS中现有解决方案的引用

添加git子模块作为VS中现有解决方案的引用,git,visual-studio,git-submodules,projects-and-solutions,Git,Visual Studio,Git Submodules,Projects And Solutions,假设我有子模块repo: _git/DbModel (only source code indexed. No /bin or /obj folders) 以及两个需要DbModel作为参考库的项目: _git/TTT _git/TPM 我已经通过GitBash将DbModel作为子模块添加到这两个模块中 git submodule add https://RepoPath/_git/DbModel 我的本地回购协议现在是这样的: Source\Repos\TTT\TTT.sln Sou

假设我有子模块repo:

_git/DbModel (only source code indexed. No /bin or /obj folders)
以及两个需要DbModel作为参考库的项目:

_git/TTT
_git/TPM
我已经通过GitBash将DbModel作为子模块添加到这两个模块中

 git submodule add https://RepoPath/_git/DbModel
我的本地回购协议现在是这样的:

Source\Repos\TTT\TTT.sln
Source\Repos\TTT\DbModel\DbModel.sln

Source\Repos\TPM\TPM.sln
Source\Repos\TPM\DbModel\DbModel.sln
我的团队资源管理器显示了现在可用的两种不同的解决方案,我可以轻松地在它们之间切换

但是。也许这是个新手问题

我不知道如何添加DbModel解决方案作为TPM和TTT的参考! 当我在VS中单击“添加引用”->“浏览”时,我只能将“.dll、.tlb、.olb、.ocx、.exe、.manifest”添加为“引用文件”


它应该如何工作?我应该每次编译子模块解决方案并添加.dll作为参考吗?我需要添加源代码。

对于对此感兴趣的人:

git submodule add https://RepoPath/_git/DbModel
git submodule init   //this is IMPORTANT
git submodule update
然后从新创建的文件夹将现有项目添加到解决方案中。如下所示:

 Source\Repos\TPM\DbModel\DbModel\DbModel.csproj
附言

Source\Repos\TPM\                  solution root folder (with main project sln file inside it)
Source\Repos\TPM\DbModel           submodule root folder (with submodule sln file)
Source\Repos\TPM\DbModel\DbModel   submodule project folder (with csproj file)