Howto resolve... Visual Studio Source Control notification "Projects have recently been added to this solution"

Visual StudioTfs

Visual Studio Problem Overview


After some use Visual Studio 2008 when opening a solution that is checked into Visual Studio Team Foundation will pop up a dialog saying:

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

This happens every time the solution is loaded (even if no projects have been added). The only way I have found to remove this minor annoyance is to completely rebuild the SLN file.

Has anyone found a better/simpler way?

Visual Studio Solutions


Solution 1 - Visual Studio

I had this recently after we moved a number of projects in the solution. I worked out eventually, that each project actual appears in solution file multiple times each with path information! So even though the path in the main reference of the project was correct it was wrong further down the file.

So go through the .sln file and make sure the paths in all the references of each project is correct.

For instance, the first reference for one of my projects is:

Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ObexPushVB", "Samples\ObjectPush\ObexPushVB\ObexPushVB.vbproj", "{E3692A59-D636-48E8-9B57-7DA80A88E517}"
EndProject

In my case the path there was correctly updated. But then we have also for that project:

SccProjectUniqueName8 = Samples\\ObjectPush\\ObexPushVB\\ObexPushVB.vbproj
SccProjectTopLevelParentUniqueName8 = InTheHand.Net.Personal.sln
SccProjectName8 = Samples/ObjectPush/ObexPushVB
SccLocalPath8 = Samples\\ObjectPush\\ObexPushVB

So all of those paths needed to be updated too! After I fixed that manually all was well. (The sample there is after the fix BTW).

Solution 2 - Visual Studio

Hey, this actually happened to me about 4 years ago.

First, it sounds to me like someone on your team doesn't have all the updates applied to their visual studio installation. Go around and get everyone upgraded to the latest service pack for your VS version.

Once that is done, unbind the solution, fix the file, rebind it and tell everyone to do a force get latest on your TFS project.

See http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/c2822ef1-d5a9-4039-9d3e-498892ce70b6

http://www.nivisec.com/2008/09/vsts-projects-have-recently-been-added.html

(broken link: http://technorati.com/posts/Yadz3Mj1pxHPSJLlnUs1tL1sIwU5jXa5rNBbIAnYdvs%3D)

Solution 3 - Visual Studio

This message will also occur if your solution has a reference to a project whose location is outside of the solution directory, but it doesn't physically exist (i.e. you hadn't checked it out before opening the solution). VSS (or TFS) will then give you that message and clicking OK will automatically get latest on the project that's missing so your solution won't have any unloaded projects in it.

EDIT:

Reading that again confuses me. Basically you get the message if your solution has a source control binding to a project that isn't inside of the folder your solution is in, and that outside project doesn't physically exist on your machine. Clicking on OK will check the project out for you.

Solution 4 - Visual Studio

In my case it was a reference to a test project which has been deleted.

I noticed that when I inspected all the projects in the Solution Explorer. Our team uses solution folders so it was not normally visible and because it was a test project it didn't have any impact on the application.

After removing the project from the solution the messages is no longer shown.

Solution 5 - Visual Studio

I'm working with Visual Studio 2013.

For me, it happened after having modified the folder's structure of my solution (I added a sub-folder for a project directly on the source code explorer). I got rid of this boring error by removing all the projects from my solution, using the solution explorer. After that, I closed Visual Studio, manually edited the .sln file and removed the whole section :

GlobalSection(TeamFoundationVersionControl) = preSolution

To finish, I just added the projects back to the solution as "Existing projects" with solution explorer. Visual Studio will recreate by itself the removed section of the .sln file.

Solution 6 - Visual Studio

The same error message can occur if someone adds a project, check-in edited solution file, but don't adds project directory to source control.

To cut a long story short - this error can mean that in .sln file there's reference to .csproj file, but the .csproj itself is physically missing.

Solution 7 - Visual Studio

In my case I renamed a(n) (unloaded) project in VS. It correctly moved the project to a new folder and no data was lost. However the solution file still pointed to the old directory which still existed but was empty (so the project could not be actually loaded).

After deleting the project from the solution (which was no problem because the folder was allready empty) the problem was solved.

Adding the project again from the new location was no problem either.

Solution 8 - Visual Studio

I had this problem after moving a number of unit test projects that were under source control (VSTS) into another folder. After this whenever I opened a branch I would get the "Projects have recently been added to this solution. Do you want to get them from source control?" error.

For some reason the csproj file from the trunk wasn't under source control which meant it was missing from the branched version. I find this happens sometimes after moving source controlled projects.

To fix it I opened the original source trunk, used Source Control Explorer to add the missing file(s), then merged the trunk to the branches to copy over the missing csproj file.

After this I could open the branched versions without the warning popping up.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEric SchoonoverView Question on Stackoverflow
Solution 1 - Visual StudioalanjmcfView Answer on Stackoverflow
Solution 2 - Visual StudioNotMeView Answer on Stackoverflow
Solution 3 - Visual StudioCᴏʀʏView Answer on Stackoverflow
Solution 4 - Visual StudiotymtamView Answer on Stackoverflow
Solution 5 - Visual StudioDaveLeGOView Answer on Stackoverflow
Solution 6 - Visual StudioArkadiusz KałkusView Answer on Stackoverflow
Solution 7 - Visual StudioJos R.View Answer on Stackoverflow
Solution 8 - Visual StudioRichard MooreView Answer on Stackoverflow