In pending changes (Visual Studio 2013 Ultimate, TFS), I all of a sudden was told I have > 100 changes in the form of deleted files (all database model files, generated by Entity Framework database first).

But I have not deleted any files. The files are plainly there, on disk and in the solution. So why does TFS tell me they're gone?

In fact, I can't undo the changes, because Visual Studio complains that "the file must be deleted from disk for the operation to succeed."

  • Since the files were created by a generator, they were likely deleted by a generator. I'd just delete them, and regen the context/model since its DB first. failing that, I'd check in everything else (the stuff you want to keep), then rename your workspace directory, and pull from TFS, using Advanced -> Get Specific version, and check both boxes to repull any files that TFS hasn't recorded as being modified client side. that should get you a clean version of your branch with all desireable changes, but without the inadvertent deletes. – Frank Thomas Dec 4 '17 at 13:33
  • Not sure what you mean by "deleted by a generator". They aren't deleted, they're there. – Christofer Ohlsson Dec 4 '17 at 14:16
  • 1
    You are getting hung up on the difference between "Deleted" and "Marked for delete" (the process to propagate a delete to TFS). yes your state is inconsistent, so you need to git back to a consistent one. checking in everything else, blowing your workspace away, and recreating it from whats on the server is the best bet. – Frank Thomas Dec 4 '17 at 14:39
  • Yeah, I solved it by deleting the files manually, and then undoing the changes. Thus, the files magically re-appeared again. So now I'm left wondering why this happened, and how I can avoid in the future :) – Christofer Ohlsson Dec 5 '17 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.