Entity data model designer won't open the edmx file
Solution 1
Fixed by deleting the file and regenerating it.
Solution 2
FOR Visual Studio 2017, 2019
I searched for the solution but come up with the installation of some NUGET packages and Extensions, nothing worked out.
Solution (Missing Entity Framework on Visual Studio)
- I searched for Visual Studio Installer on my machine and opened it.
- Under Visual Studio Professional 2017.
- I clicked on More to see more options. I selected Modify
- Select Individual Components (Second Tab)
- Check Entity Framework Under SDKs, libraries, and framework
- and then click Modify EDMX file will open after the process gets completed.
Solution 3
This has happened to me a few times, usually when pulling a solution out of subversion. Rebuilding the project has always fixed the issue for me.
Solution 4
I also encounter that annoying screen. No, I do NOT want to edit my model in XML... I want the pretty designer! In my case I added a table which did not have a primary key. To fix...
-
Open the edmx in XML
-
Delete the erroneous table. It should be well defined with an "<-- ERROR" comment.
-
Clean and Rebuild.
-
Close and re-open Visual Studio (yes, it's annoying but necessary)
-
Rebuild one more time, then open your edmx file. Should open the designer fine.
Hope this helps.
Solution 5
This happens to us quite a bit (usually from a bad merge) and our EDMX file is over 50k lines, which makes eyeballing the problem impossible. However, firstly, you can use one of the online XML parsers (eg. https://onlinexmltools.com/validate-xml) to determine if the XML is correct. Once the XML is valid, the file should at least open in the XML editor (I assume you are using Visual Studio): you can then use Alt+PageDn (Edit > Goto > Next Issue) - the wiggly underscore and associated tip are often of genuine help. I have managed to resurrect our EDMX several times this way.
Related videos on Youtube
Legion
Updated on January 22, 2022Comments
-
Legion over 2 years
The strange thing is, it was working fine a few days ago. I added a new column to a table and was going to update the model through the designer and now it says "The Entity Data Model Designer is unable to display the file you requested. You can edit the model using the XML Editor."
There's nothing particularly noteworthy about the new field, it's just a non nullable bit field in SQL Server 2008.
-
Felix about 8 yearsThis was the cause for me too -- I think the reason is that EntityFramework is a nuget package, and we exclude the packages/ directory from source control (because it's binaries that just get-redownloaded anyway). A rebuild causes all the packages to get downloaded, which makes the EntityFramework dlls and such available.
-
Josue Rocha almost 8 yearsHow do you regenerate the .edmx file?
-
CodeMilian over 7 yearsExactly what happened to me
-
Alejandro Montilla over 6 yearsI liked the "annoying but necessary".. Welcome to SO.
-
Ashley over 6 yearshahaha.. Thanks. :) Happy to FINALLY be able to help. I've searched SO for years. Finding good, solid answers for Entity Framework has been my first real contribution. :)
-
Alejandro Montilla over 6 yearsRemember that answering is not the only way you could help, also voting, commenting, review queues. You still dont have the reputation for those accions, but keep the good work and you will get there in no time. :)
-
Haris over 5 yearsRegarding the point 5, the exact library name is "Entity Framework 6 tools".
-
K-Dawg about 5 yearsI think you just delete it and make it again like you did the first time.
-
MichaelM almost 5 yearsWasn't precisely my solution; instead of comments I had Intellisense alerting me to issues with my XML. After cleaning up those issues I was able to view the
edmx
again. Had to close and re-open the XML several times in order to refresh the Intellisense and see the latest break, but got it working -
Kevin Amorim about 4 yearsOpened the XML file and found some merge errors from SVN. Worked for me, without having to restart or rebuild. Thanks for pointing out the XML.
-
Alexei - check Codidact almost 4 yearsThis works in theory, but it will remove all customization like renaming of some navigation properties.
-
OutstandingBill about 3 yearsThis solved the problem for me because I made a mistake manually resolving Git merge conflicts, resulting in an orphaned
</EntitySetMapping>
tag. The build found the error for me. Thanks! -
mBardos over 2 yearsThere are some more URLs to change, see accepted response here: stackoverflow.com/questions/21152692/…