TFS / Visual Studio says I have changes in the form of deleted files, but the files aren't deleted

2

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."

Christofer Ohlsson

Posted 2017-12-04T12:01:54.577

Reputation: 121

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 – 2017-12-04T13:33:33.887

Not sure what you mean by "deleted by a generator". They aren't deleted, they're there. – Christofer Ohlsson – 2017-12-04T14:16:40.717

1You 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 – 2017-12-04T14:39:04.093

1Yeah, 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 – 2017-12-05T08:57:03.757

No answers