Can't open the EDMX file in the designer? Here's the workaround.

People email me this question every once in a while so I thought I'd blog it.

It's possible to get the EDMX file into a state that confuses the designer. I know that I've done it by making changes in the designer and then closing the file without saving those changes. After that, I can't open the file back up in the designer. I double click on the file and nothing happens.

The workaround is to open the file up in the XML view (right click on the EDMX file in the Solution Explorer, choose Open With... and then select the XML Editor.

Once the file is open in the XML Editor, just close it. You don't need to make changes or even save it. Now you can double click on the file and open it back up in the designer.

I imagine this strange behavior will be gone in the VS2010 version but it definitely bites folks in the rear.

Update: Tested this in the VS2010 Beta 1 and it is, indeed, fixed!

#1 Sergey on 3.12.2009 at 12:12 AM

This helped me! Thanks!

#2 Matthieu MEZIL on 3.13.2009 at 6:53 AM

Thanks Julie, I will gain many time.Before your post, I restarted VS in this case.

#3 EricTN on 3.25.2009 at 8:59 PM

All I can say for this post is, Thank You.

#4 Dave on 3.31.2009 at 4:55 PM

Thanks for the tip!What I had been doing was closing and reopening the solution/project to fix it.

#5 Nicholas Head on 4.24.2009 at 12:19 PM

I boggles my mind why this hasn't been fixed yet. Hotfixes, anyone?

#6 Bernard Dusablon on 5.05.2009 at 4:04 PM

Thank you for this trick it caused me headaches reopening VStudio all the time.

#7 Zach on 6.07.2009 at 6:41 PM

Wow I can't believe how much time I have burned on this. THANK YOU sooo much for this tip!

#8 Julie on 6.07.2009 at 6:48 PM

The fix is definitely in the EF4 designer. I just updated the post to point that out. But we're still stuck with it in VS2008.

#9 Adam on 7.09.2009 at 10:06 AM

Excellent, thanks for that

#10 Rob on 11.01.2009 at 5:09 PM

Thanks -- you just made my day! I was going crazy trying to figure out why I couldn't open my .edmx file.

#11 Ramone Hamilton on 11.09.2009 at 2:19 PM

Man thanks a mil this helped me out a lot.

#12 Gabriel Lozano-Moran on 11.24.2009 at 2:09 AM

I believe I have found a better workaround:

I have tried this on Windows XP x64 only:

1) Start the Registry Editor

2) Navigate to the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Editors\{c99aea30-8e36-4515-b76f-496f5a48a6aa}

3) Add a new String Value named LinkedEditorGuid.

4) Set the value of LinkedEditorGuid to {FA3CD31E-987B-443A-9B81-186104E8DAC1}. (this is the GUID for the XML editor but it seems to work)

#13 Don on 12.10.2009 at 12:05 PM

Holy hell! Thank you so much! I just spent 2 hours trying to figure out why my edmx.designer.cs file was referring to non-existing columns that were already deleted from the database and then I came across this.

#14 Prabhash on 1.09.2010 at 1:43 AM

Thank you so much!!!

What a exact and quick solution.

#15 dePaula on 2.16.2010 at 3:46 PM

You've did it! Clear answer to very strange problem. Thank you very much.

#16 ehsan on 2.20.2010 at 12:24 AM

very good. thanks

#17 shobman on 3.23.2010 at 1:23 AM

Rubbish!! I would never have believed this works, but it does. Thanks so much!

#18 LarryJ on 4.06.2010 at 1:37 PM

Thanks so much!!!! You probably just saved me hours of frustration!!! Mad Props unto thee!!!!!!!!!!!!!!!!

#19 Julie on 4.06.2010 at 1:41 PM

@LarryJ- ahh ...comments like these make my day. Glad it helped. :)

#20 RCM on 4.06.2010 at 11:48 PM

what is the default editor for this? I have installed ent library 5.0 just now. and I opened a sample. edmx file is shown as unrecognized format and all I can do is Open in xml editor. Please help

#21 Michael on 4.23.2010 at 7:18 AM

Thank you! Works in VS2008 as well

#22 kiran on 8.07.2010 at 12:35 AM

Hi very nice article, i am also facing this same issues, after reading this article i got clear idea :)

#23 Vimal on 9.18.2010 at 10:54 AM

Thank you so much.......

Very nice article dude :-)