Files marked for deletion are preventing me from checking into TFS

Rod At Work 866 Reputation points
2020-12-01T18:56:43.2+00:00

I am having problems checking in files into TFS. (We're using TFVC.) We have TFS 2015 on-prem. I had to update an Entity Framework 6 EDMX file for new tables that were added to the database. Normally this is a straightforward process of opening the EDMX designer, right mouse button clicking on the designer background and doing an update from database command.

However, it failed miserably. The project would never build. I couldn't access tables. Visual Studio 2019 refused to add the new tables. etc. I tried for several days to fix it, including deleting all the tables out of the EDMX designer, then recreating them. But it never resolved the issue. So, after struggling with it for days I gave up by deleting the .EDMX file and using EF's Code First from Existing Database. That worked, so I could finally build the project and access the new tables.

But it also has messed up my VS 2019 project with TFS. Whenever I try to edit most tables that were generated by using code first, I get the following error message:

43960-check-out-error-2020-12-01-093925.png

Looking at the Model folder in my VS project I see that most of the tables are not under TFS source control:

44136-solution-explorer-2020-12-01-095419.png

But looking at the Pending Changes in VS 2019, I see that VS 2019 thinks most of those the class files associated with the tables must be deleted

44137-pending-changes-2020-12-01-095509.png

I have no idea at all how to fix this. I need to get those new class files under source control, not the old ones. In fact, I don't even know what version of those class files VS 2019 and TFS 2015 thinks need to be deleted. I'm getting that error I showed in the first pic just trying to edit any of those class files.

How do I fix whatever I've done wrong, so that I can save to TFS the current code first generated class files?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,395 questions
{count} votes

1 additional answer

Sort by: Most helpful
  1. Rod At Work 866 Reputation points
    2020-12-01T22:04:30.867+00:00

    Thank you, @Dave Patrick , knowing where to ask a question is at least 50% getting an answer.