question

RodAtWork avatar image
0 Votes"
RodAtWork asked TravisCragg-MSFT edited

Files marked for deletion are preventing me from checking into TFS

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?


dotnet-entity-framework
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @RodAtWork

Idea 1
My last team used EDMX but was unstable after 30 plus tables so we moved to code first by creating a new class project then tying the business layer to the new class project rather trying to force things.

Idea 2
Clone the repository to a completely new folder and inspect what's in the Visual Studio solution, depending on the state of source code perhaps you can work from there.

0 Votes 0 ·

Hi @karenpayneoregon ,

Concerning Idea 2: I know how to clone using Git, but not using TFVC. They use TFVC where I work.

Concerning Idea 1: That's a good idea. If I get stuck for long on this, that's what I'll do. My guess is there's something "off" about the TFVC workspace.

0 Votes 0 ·
DSPatrick avatar image
1 Vote"
DSPatrick answered

TFS is not currently supported here on QnA. The product group for TFS actively monitors questions over at
https://developercommunity.visualstudio.com/spaces/22/index.html

--please don't forget to Accept as answer if the reply is helpful--




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RodAtWork avatar image
0 Votes"
RodAtWork answered DSPatrick commented

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

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You're quite welcome.

0 Votes 0 ·