Thursday, May 14, 2009

ADO.NET Entity Data Model Designer doesn’t open model when double-clicking

I understand that the ADO.NET Entity Data Model Designer is still in its infancy, but I have to wonder how this bug was missed. If you open a model in the ADO.NET Entity Data Model Designer by double-click on it or right-clicking and choosing Open the model opens fine. Close it and try the same thing again. The model will not open.

Luckily the workaround is not too much of a pain. Do the following to get the designer to open the model again.

  1. Close the model.
  2. Right-click on the Model.edmx (or similarly named file) in the Solution Explorer in Visual Studio 2008.
  3. Choose Open With…
  4. In the windows that comes up, choose XML Editor and click the OK button. Actually you can also use the Source Code (Text) Editor. You really just need an editor that can read xml, so most of them will work. The key is to open it in something other than the ADO.NET Entity Data Model Designer.
  5. Close Model.
  6. Double-click on the Model.edmx (or similarly named file) to open it as you usually would.

Unfortunately, you will need to do this every time you close the model and then want to re-open it. It is better than the other workaround of restarting Visual Studio 2008.

18 comments:

micdk said...

This is the exact same problem I've encountered. Did you ever find a fix for it other than the workaround?

Brent V said...

Michael,
I never found a true solution. The only thing I found is the work around that I described above where you open with another editor and then you can open as expected after you do that.

Does that make sense?

Brent

micdk said...

Oh that's too bad cuz the work around didn't work for me. I got an unspecified error, I believe it was, when I tried to open it with the XML Editor. Anyway, I decided to use Linq to SQL instead :) Thanks for the reply though :)

Brent V said...

Michael,

Well, I'm sorry to hear that. Keep me posted if you figure out another solution or work around.

Thanks for the info and feedback.

Brent

Unknown said...

I had the same issue and this indeed works. Thanks :)

Have you considered submitting a bug report?

Brent V said...

Lakario,

Thanks for the confirmation. I have not submitted a bug because I don't know how to reproduce it reliably in all projects. I have other WF projects that work just fine and don't show this behavior. I don't have the Workflows in a separate assembly either, so maybe that is part of the bug. I need to research it further. I just haven't had the time to nail down the exact issue. If anyone else can comment that would be helpful.

Thanks!

Brent

Unknown said...

Having the same problem, and your solution worked. Thanks for posting it.

Brent V said...

Hi Tom,

Sweet. Thanks for the confirmation / feedback.

Brent

Unknown said...

If it's of any use, I encountered the bug in an ASP.NET MVC application with the EF located in a separate assembly. If you submit the bug to Microsoft Connect with a few scenarios where you've produced it, I'm bet that would be enough for them to act on.

Brent V said...

Hi Lakario,

I found that having the EF in a separate assembly is a necessary condition for the bug to appear in my case also. I don't know if that is the only issue or not. I have not nailed it down that much yet. When I do, I think submitting it to MS would be a great idea.

Thank you for your feedback and idea.

Thx,

Brent

Anonymous said...

Same problem here. Your workaround helped me out. You should definitely report this bug ;)

Unknown said...

also worked for me. and it's also in a separated assembly.

Brent V said...

JFrank,

Thanks for the confirmation.

Brent

Anonymous said...

This happens to me as well on my work machine, while on my home pc (Windows7, 64bit, VS2008SP1) the edmx editor doesn't show up at all. It looks like it's not even registered as a designer for that file type, I can only open it as XML by double-clicking the file!!

Anybody having the same issue?

Rodrigo

Unknown said...

@Rodrigo

Do you have the ability to create a new ADO.NET Entity Data Model from the file templates menu?

Unknown said...

Another voice to say I get the same error and your workaround works.

Anonymous said...

Frustrating bug. Thanks for posting this workaround!

Wellych said...

Solution that worked for me:
1) Open edmx with Xml editor
2) Replace all occurrences of xml namespace http://schemas.microsoft.com/ado/2008/10/...
to http://schemas.microsoft.com/ado/2009/11/...."