Add existing project to source control in Visual Studio 2017 solution using Git repo in Team Explorer

Kevin T picture Kevin T · May 15, 2018 · Viewed 9.2k times · Source

I'm struggling to add an existing DB model project to an application solution in Visual Studio 2017.

I'm using Git instead of TFVC for the repo and source control.

When I add the existing project, everything builds fine at the solution level, but when I go to add the project to the solution in source control I don't see any changes, I've gone through dozens of MS Docs and forum posts around it but can't find a solution to this particular problem.

Anyone else experience this and know a workaround? I can only find docs surrounding TFVC which is useless to me as we moved across from TFVC to Git a year ago.

Apparently the VS Dev team are aware of this but haven't done anything about it, too concerned with new frameworks to worry about their platform actually working with all the plug-ins they officially support :(

VS doesn't give me any options to "Add to source control" when I select the newly added project.

Answer

Kevin T picture Kevin T · May 17, 2018

So after trying everything I went back to the old VS hack of adding the project to the solution folder locally then showing all files in VS, then that allowed me to add it to the repository. Very counter intuitive, can't believe I had to resort to a hack.