Strange exception when validating model/generating code

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
brinkie
Posts: 2
Joined: Wed 03 Sep 2014 22:41

Strange exception when validating model/generating code

Post by brinkie » Wed 03 Sep 2014 22:51

Hi,

When I try to validate my EF6 model or generate code, I get an exception (see attachment):
"Het doel van een aanroep heeft een uitzondering veroorzaakt"

It's in Dutch, because that's where I live/work. It translates to something like:
"The purpose of a call caused an exception"

Can you tell me how to proceed resolving this issue?

Best regards,
Raymond

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Strange exception when validating model/generating code

Post by Shalex » Fri 05 Sep 2014 11:55

1. You are working with Entity Developer (the Devart Entity Model item, *.edml), aren't you?
2. Is it a standalone version of Entity Developer or the one integrated in Visual Studio?
3. Specify a call stack of the exception. If there is no call stack, you can obtain it by connecting from Visual Studio (Debug | Attach to Proccess) to the instance of Entity Developer or Visual Studio (where you are running Create Model Wizard). Before attaching don't forget to make these settings in your Visual Studio you are attaching from: a) in the (Debug | Exceptions) window select Common Language Runtime Exceptions; b) in the (Tools | Options) window, Debugging | General - clear Enable Just My Code (Managed Only).
4. Tell us the exact versions of your Entity Developer and Visual Studio.
5. Send us a test model and specify the steps we should follow using it to reproduce the issue.

brinkie
Posts: 2
Joined: Wed 03 Sep 2014 22:41

Re: Strange exception when validating model/generating code

Post by brinkie » Sat 06 Sep 2014 18:33

Hi,

Thanks for assisting me with this issue.

1. Correct.
2. Standalone version
3. There is no stack trace, not even in Visual Studio. Detaching the debugger shows:
A. A first chance exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in mscorlib.dll. And after I 'Continue':
B. A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll (but no stack trace).
4. I use Visual Studio 2013 and Entity Developer version 5.7.422.
5. I'll do that!

Best regards,
Raymond

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Strange exception when validating model/generating code

Post by Shalex » Mon 08 Sep 2014 11:39

Thank you for the test model. We have reproduced the error and are investigating the issue. We will notify you about the results of our investigation as soon as any are available.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Strange exception when validating model/generating code

Post by Shalex » Mon 22 Sep 2014 15:50

The behaviour of the latest (5.7.441) build of Entity Developer is improved. Now your model doesn't throw error window but writes the "The given key was not present in the dictionary." message in the Error List window of Entity Developer. Unfortunately, it doesn't include a useful information about a problem in the model.

The Validate (Generate Code also calls Validate) functionality of Entity Developer is fully implemented basing on Entity Framework runtime (System.Data.Entity.dll/System.Data.Entity.Design.dll for EF1/EF4/EF5 and EntityFramework.dll for EF6). The "The given key was not present in the dictionary." error is generated by EF runtime, and this is a bug of Entity Framework. We don't know what exactly causes this fail.

We recommend to find out the reason of the problem in the following way: recreate CSDL from SSDL step by step to localize the problem and fix (or work around) it.

If we can be of any further assistance, let us know.

Post Reply