'ADO.NET EDMX file is corrupt but XML is valid

I've been working on a model the last days in ADO.NET Entity Data Model Designer. I'm not sure what action I did in the designer but suddenly the window of the designer looked weird, jumped to the left and seemed corrupt. So I closed the file in the hope that re-opening would result in the diagram to show up again.

Instead I got the error: The Entity Data Model Designer is unable to display the file you requested. You can edit the model using the XML editor.

When I edit the XML it seems all fine. The only 'warnings' I get are 11007 and 11008 about associations and entity types not being mapped. And that is correct, I'm just designing the model for now. In the past I created a little windows program that reads the XML and makes a HTML/Word document out of it. When I run that tool the output seems perfectly fine.

I tried to remove the last added table and associations from the XML but no luck. I also tried to open the file in a newer visual studio (2022), also same error. I'm currently using VS2019 with the entity framework 6 tools.

Also when I create a new EDMX file with some entities and associations it works fine and it displays the diagram. I don't see anything different in the structure from a new file and my corrupt file.

There are 57 entity types with their associations. Not sure how I'm going to be able to verify everything in the file manually. It would be nice to have some tool that I can use to generate or validate the model and to see some error on where the problem might be.

Is there a way to find the issue that the designer trips over?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source