Entity data model designer won't open the edmx file

.net ado.net entity-framework-5

25078 观看


1276 作者的声誉

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.

作者: Legion 的来源 发布者: 2013 年 2 月 14 日

回应 12


1276 作者的声誉


Fixed by deleting the file and regenerating it.

作者: Legion 发布者: 2013 年 2 月 14 日


101 作者的声誉

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.

作者: Dmass 发布者: 2015 年 8 月 26 日


343 作者的声誉

This happened to me when I added a field to an table that was used in a function as RETURN (SELECT TableName.* .... )

The CollectionSet subnode of the ReturnType node for that function in the EDMX wasn't refreshed.

To fix it, you need to simply run ALTER FUNCTION (without actually changing it), then update the model from database within Visual Studio.

作者: Edgar 发布者: 2016 年 9 月 19 日


683 作者的声誉

Just had a similar problem: nothing in the designer window.

Double clicking each of the entities in the model browser made them re-appear.

作者: Richard Barraclough 发布者: 2017 年 1 月 25 日


2977 作者的声誉

I don't have the option of deleting the edmx.

I tried cleaning, exiting vs, and then building.

Solution: Copy paste from source control into the .edmx and .edmx.diagram, then rebuild.

I was getting this error from a particularly nasty merge.

作者: christo8989 发布者: 2017 年 2 月 10 日


37 作者的声誉

Some times this issue happens because the XML representation of the model has some conflicts. In my case, the error was caused because the model had a conflicted reference, in other words, there was a reference to a table that was manually removed in the XML and the removal wasn't done properly (they leaved the EntityType reference but removed all the rest).

I just opened the XML file and the issue was underlined, I just removed it, and it fixed the issue, the model was shown without any problems.

作者: Alejandro Tobón 发布者: 2017 年 5 月 18 日


121 作者的声誉

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.

作者: Ashley 发布者: 2017 年 10 月 20 日


583 作者的声誉

I solved the problem by modifying the installation and selecting .net desktop development module + Individual components: Entity Framework 6 tools and .NET Framework 3.5 development tools.

I don't know if less could have done the trick.

作者: thomas nn 发布者: 2018 年 2 月 21 日


2638 作者的声誉

FOR Visual Studio 2017

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 opens after the process gets completed.
作者: Charlie 发布者: 2018 年 5 月 30 日


445 作者的声誉

I just had the same problem after a merge. Luckily, undoing the changes to the edmx and related files in checkin window and re-adding the new files solved it for me.

作者: Ege Bayrak 发布者: 2018 年 6 月 7 日


41 作者的声誉

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.

作者: Fireman Sam 发布者: 2019 年 7 月 31 日


83284 作者的声誉

In Visual Studio 2019 I could solve the problem by opening the .edmx file using the built-in XML editor.

Visual Studio shows the error(s) underlined like this:

enter image description here

Check the Error List window (red X icon)...

Once you get rid of all errors, then the designer will show as expected.

作者: Leniel Maccaferri 发布者: 2019 年 8 月 9 日