Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Every time I open my VS solution I get “Projects have recently been added to this solution. Do you want to get them from source control?”

I don't know exactly how, but on a certain moment we ruined our complete visual studio solution. It wouldn't build anymore, nor clean, nor find any reference.

Afters hours of searching and trying to fix everything we got to the point that everything was building and running again.

However.. every time we open our solution we will get the message “Projects have recently been added to this solution. Do you want to get them from source control?”.

This is probably cause by trying to fix one thing and breaking something else.

How do we get rid of this message?

Projects have recently been added to this solution. Do you want to get them from source control?

like image 951
Tom B. Avatar asked Feb 12 '16 07:02

Tom B.


People also ask

How do I add multiple projects to a solution in Visual Studio?

To add existing projects to the solution: Right click the Solution node in Solution Explorer select Add -> Multiple Projects.

How do I add a project solution to Visual Studio?

On Visual Studio for Mac, right-click the solution name in the Solution Pad, then choose Add ➞ Add New Project.


Video Answer


3 Answers

Thanks to some research and trying some various options this is what solved it in our case.

1. Unbinding the solution file from TFS

Unbind the solution file (.sln) from TFS. We did this (in visual studio of course) by going to the menu File => Source Control => Change Source Control.

Unbinding the solution file

2. Cleaning the solution file by deleting globalsection

We had to clean the solution file (.sln) by opening it in a text editor (we used notepad++). We removed all occurences of GlobalSection(TeamFoundationVersionControl) = preSolution. Including the mentioned starting tag and the ending tag EndGlobalSection.

3. Bind the solution file to TFS again

Finally we binded the solution file (.sln) to TFS again. We did this (in visual studio of course) by going to the menu File => Source Control => Change Source Control

Binding the solution file to TFS again

Thanks to http://www.nivisec.com/2008/09/vsts-projects-have-recently-been-added.html who pointed us in the right direction after some hours of research.

like image 50
Tom B. Avatar answered Oct 18 '22 19:10

Tom B.


I had this same error. Turned out to be a project that was deleted from source control but still referenced in the .sln file. Was difficult to spot as we had >100 projects in the solution.

like image 42
Mark Heath Avatar answered Oct 18 '22 21:10

Mark Heath


Had a same problem, project was removed from solution but for some reason SccNumberOfProjects under GlobalSection(TeamFoundationVersionControl) = preSolution in solution file was at wrong count - there was 56 projects in solution and reported number was 57.

like image 1
nighthawk Avatar answered Oct 18 '22 19:10

nighthawk