views:

230

answers:

2

In my App i when debuging a have this exception: {"Operation could destabilize the runtime."} in the foreach loop:

foreach (var item in Model)

when i hover the model in debugmode the first time i says :

ResultView=>Expending the result view will enumarate the enumarable

        base=>Operation Could not destabilize the runtime.

after hovering a couple more times, a get the ResultView shows my data. thats when i, in debugmode...

when i run my app without debugin it a overing over the Mode it throws this exception

what does this mean??

UPDATE The model is IQueryable by it still doesnt work, only when i'm i debug mode

+5  A: 

It possibly means that I made a mistake when implementing the code generator for expression trees. When an expression tree lambda is turned into a delegate, we spit IL dynamically into the delegate body. If that IL code is not well-formed and unverifiable, then running it could make the jitter generate bad code, and that could, in theory, destabilize the runtime. I thought we caught all the unverifiable code defects, but it is possible that a few slipped through.

If you have a small, simple, self-contained repro of the problem and it looks like it matches the diagnosis above, send me an email via the contact link on my blog, and I'll get a bug entered on the team that now owns the IL generation code. The ideal repro would just be code which generates an offending expression tree lambda, compiles it, and gets the exception.

Thanks!

Eric Lippert