Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop Visual Studio from closing the solution when changing the active Git repo

I have a solution that contains projects which are contained in several Git repositories. The .sln file is in one of the repos. It basically looks like this:

Repo1
  Solution.sln
  ProjectA
Repo2
  ProjectB
  ProjectC

Using the Git source control provider that comes with Visual Studio 2015 kind of works.

But sometimes when I switch the active Git repository using the “Connect” pane in Team Explorer (Ctrl+Alt+F4), Visual Studio will close the solution, but sometimes it will not.

How can I stop Visual Studio from closing the solution?

like image 200
Martin Avatar asked May 20 '16 09:05

Martin


1 Answers

Team Explorer makes an assumption that your .sln is contained in one repo. Imagine what would happen if someone clones just Repo1 but not Repo2, or clones them into different relative paths than you expect.

In your situation, I would argue that you ought to either

  • Put all of your projects in one repo OR
  • Have ProjectB and ProjectC produce NuGet packages that you consume from ProjectA
like image 100
Saeed Avatar answered Oct 30 '22 12:10

Saeed