visual-studio 如何解决... Visual Studio 源代码管理通知“项目最近已添加到此解决方案”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1251502/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Howto resolve... Visual Studio Source Control notification "Projects have recently been added to this solution"
提问by Eric Schoonover
After some use Visual Studio 2008 when opening a solution that is checked into Visual Studio Team Foundation will pop up a dialog saying:
在使用 Visual Studio 2008 打开已签入 Visual Studio Team Foundation 的解决方案时,会弹出一个对话框,说明:
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.
每次加载解决方案时都会发生这种情况(即使没有添加任何项目)。我发现消除这个小烦恼的唯一方法是完全重建 SLN 文件。
Has anyone found a better/simpler way?
有没有人找到更好/更简单的方法?
采纳答案by NotMe
Hey, this actually happened to me about 4 years ago.
嘿,这实际上发生在我大约 4 年前。
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.
首先,在我看来,您团队中的某个人没有将所有更新应用到他们的 Visual Studio 安装中。四处走动,让每个人都升级到适用于您的 VS 版本的最新服务包。
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.
完成后,解绑解决方案,修复文件,重新绑定并告诉所有人强制获取最新的 TFS 项目。
http://www.nivisec.com/2008/09/vsts-projects-have-recently-been-added.html
http://www.nvisec.com/2008/09/vsts-projects-have-recently-been- added.html
(broken link: http://technorati.com/posts/Yadz3Mj1pxHPSJLlnUs1tL1sIwU5jXa5rNBbIAnYdvs%3D)
(断开的链接:http: //technorati.com/posts/Yadz3Mj1pxHPSJLlnUs1tL1sIwU5jXa5rNBbIAnYdvs%3D)
回答by alanjmcf
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 multipletimes 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 allthe references of each project is correct.
因此,检查 .sln 文件并确保每个项目的所有引用中的路径都是正确的。
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).
所以所有这些路径也需要更新!在我手动修复后一切都很好。(这里的示例是在修复 BTW 之后)。
回答by C???
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.
如果您的解决方案引用了一个位于解决方案目录之外的项目,但它实际上并不存在(即您在打开解决方案之前没有检出它),也会出现此消息。VSS(或 TFS)然后会给您该消息,单击“确定”将自动获取丢失的项目的最新信息,因此您的解决方案中不会有任何卸载的项目。
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.
再次阅读使我感到困惑。基本上,如果您的解决方案具有绑定到不在您的解决方案所在文件夹内的项目的源代码控制绑定,并且该外部项目在您的计算机上实际不存在,则您会收到消息。单击“确定”将为您检查项目。
回答by tymtam
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.
从解决方案中删除项目后,不再显示消息。
回答by DaveLeGO
I'm working with Visual Studio 2013.
我正在使用 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 :
对我来说,它发生在修改了我的解决方案的文件夹结构之后(我直接在源代码资源管理器上为项目添加了一个子文件夹)。通过使用解决方案资源管理器从我的解决方案中删除所有项目,我摆脱了这个无聊的错误。之后,我关闭了 Visual Studio,手动编辑了 .sln 文件并删除了整个部分:
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.
最后,我只是使用解决方案资源管理器将项目作为“现有项目”添加回解决方案。Visual Studio 将自行重新创建 .sln 文件的已删除部分。
回答by Landeeyo
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.
长话短说 - 此错误可能意味着在 .sln 文件中引用了 .csproj 文件,但实际上缺少 .csproj 本身。
回答by Jos R.
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).
就我而言,我在 VS 中重命名了一个(n)(卸载)项目。它正确地将项目移动到了一个新文件夹,并且没有丢失任何数据。然而,解决方案文件仍然指向仍然存在但为空的旧目录(因此无法实际加载项目)。
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.
从新位置再次添加项目也没有问题。
回答by Richard Moore
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.
在将一些受源代码管理 (VSTS) 控制的单元测试项目移动到另一个文件夹后,我遇到了这个问题。在此之后,每当我打开一个分支时,我都会收到“最近已将项目添加到此解决方案中。您想从源代码管理中获取它们吗?” 错误。
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.
出于某种原因,主干中的 csproj 文件不受源代码控制,这意味着分支版本中缺少它。我发现在移动源代码控制项目后有时会发生这种情况。
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.
为了修复它,我打开了原始源主干,使用源代码管理资源管理器添加丢失的文件,然后将主干合并到分支以复制丢失的 csproj 文件。
After this I could open the branched versions without the warning popping up.
在此之后,我可以打开分支版本而不会弹出警告。

