Files marked for deletion are preventing me from checking into TFS

Rod At Work 821 Reputation points

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:


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


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


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?

Entity Framework 6.0
Entity Framework 6.0
A Microsoft open-source object-database mapper for .NET.
227 questions
{count} votes

1 additional answer

Sort by: Most helpful
  1. Rod At Work 821 Reputation points

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