简体   繁体   English

签入 TFS 时项目不存在

[英]Item does not exist when check in TFS

I use VS 2013 to check-in a file to TFS 2012 and get the following error:我使用 VS 2013 将文件签入到 TFS 2012 并收到以下错误:

The item $/MyTeamProject/MyProject/MyInterface/IAllocationBLL.cs does not exist at the specified version, or you do not have permission to access it.

Other files just work fine.其他文件工作正常。 I notice that the Last Check-in date is missing.我注意到缺少Last Check-in日期。

在此处输入图片说明

If I undo this file, it then disappears on TFS.如果我撤消此文件,它就会在 TFS 上消失。 When I edit this file again, it back to TFS and still missing Last Check-in .当我再次编辑此文件时,它返回到 TFS 并且仍然缺少Last Check-in I still get the same error checking in this file.我仍然在这个文件中得到同样的错误检查。 Any advice would be appreciated.任何建议将不胜感激。

最好的方法是将文件保存为外部备份,然后撤消,在整个项目中签入,然后再次将文件添加到项目中。

I had same/similar issue today.我今天遇到了相同/类似的问题。 Didn't found proper (or easy) solution online, and here is my workaround:没有在网上找到合适(或简单)的解决方案,这是我的解决方法:

  1. (Optional) Backup project just in case (可选)备份项目以防万一
  2. Delete file locally本地删除文件
  3. In Source Control Explorer undo changes (was delete because, auto generated files are always deleted then generated again, and i think this is just bug in studio).在源代码管理资源管理器中撤消更改(被删除是因为,自动生成的文件总是被删除然后再次生成,我认为这只是工作室中的错误)。 Ignore warnings.忽略警告。 You will have now source controlled file with exclamation because file not exist.您现在将拥有带有感叹号的源代码控制文件,因为文件不存在。
  4. Open designer and just move some table and save - that will generate all files again without updating model from database.打开设计器,只需移动一些表并保存 - 这将再次生成所有文件,而无需从数据库更新模型。

VOILA - your file is under source control again.瞧 - 您的文件再次受到源代码控制。

I received this error with Visual Studio 2019 and was able to resolve it by:我在 Visual Studio 2019 中收到此错误,并能够通过以下方式解决它:

  1. Backup your project, just in case.备份您的项目,以防万一。 You shouldn't need it though.不过你应该不需要它。
  2. Undo the changes for everything in the project in the Team Explorer.在团队资源管理器中撤消项目中所有内容的更改。
  3. Go to the Source Control Explorer, Right Click the Project, and click Add Items To Folder.转到源代码管理资源管理器,右键单击项目,然后单击将项目添加到文件夹。
  4. Select all the items in the project folder.选择项目文件夹中的所有项目。 Click Finish单击完成
  5. Items should reappear to check-in.物品应重新出现以进行登记。 Click Check-in and it should work.单击签入,它应该可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM