Entity data model designer won't open the edmx file

48,549

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)

  1. I searched for Visual Studio Installer on my machine and opened it.
  2. Under Visual Studio Professional 2017.
  3. I clicked on More to see more options. I selected Modify
  4. Select Individual Components (Second Tab)
  5. Check Entity Framework Under SDKs, libraries, and framework
  6. 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...

  1. Open the edmx in XML

  2. Delete the erroneous table. It should be well defined with an "<-- ERROR" comment.

  3. Clean and Rebuild.

  4. Close and re-open Visual Studio (yes, it's annoying but necessary)

  5. 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.

Share:
48,549

Related videos on Youtube

Legion
Author by

Legion

Updated on January 22, 2022

Comments

  • Legion
    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
    Felix about 8 years
    This 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
    Josue Rocha almost 8 years
    How do you regenerate the .edmx file?
  • CodeMilian
    CodeMilian over 7 years
    Exactly what happened to me
  • Alejandro Montilla
    Alejandro Montilla over 6 years
    I liked the "annoying but necessary".. Welcome to SO.
  • Ashley
    Ashley over 6 years
    hahaha.. 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
    Alejandro Montilla over 6 years
    Remember 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
    Haris over 5 years
    Regarding the point 5, the exact library name is "Entity Framework 6 tools".
  • K-Dawg
    K-Dawg about 5 years
    I think you just delete it and make it again like you did the first time.
  • MichaelM
    MichaelM almost 5 years
    Wasn'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
    Kevin Amorim about 4 years
    Opened 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
    Alexei - check Codidact almost 4 years
    This works in theory, but it will remove all customization like renaming of some navigation properties.
  • OutstandingBill
    OutstandingBill about 3 years
    This 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
    mBardos over 2 years
    There are some more URLs to change, see accepted response here: stackoverflow.com/questions/21152692/…