开发者

System.ExecutionEngineException PropertyChanged

开发者 https://www.devze.com 2022-12-15 15:14 出处:网络
If anyone can provide some help for this one, I\'d be very grateful! We are using: Silverlight 3 / MVVM / Blacklight DragDock Control / ComponentOne Silverlight Controls

If anyone can provide some help for this one, I'd be very grateful!

We are using: Silverlight 3 / MVVM / Blacklight DragDock Control / ComponentOne Silverlight Controls

I have a Silverlight application that relies heavily on the MVVM pattern. The application has seemingly been running fine, until recently. I have started to notice semi-random (semi-random = over a long enough period of time ~2 - 5 mins) I can reproduce a System.ExecutionEngineException coming from the PropertyChanged event being raised. The property name which the notification is being raised for is not always the same property name (the firing of the property change event hap开发者_StackOverflow中文版pens in a base ViewModel class).

The code basically looks like this:

if (PropertyChanged != null) Application.Current.RootVisual.Dispatcher.BeginInvoke( () => PropertyChanged(this, new PropertyChangedEventArgs(propertyName)));

The code works for everything else in the application. Basically everything that throws off a property changed event goes through this. I'm not sure why this is failing all of a sudden. Please throw some thoughts my way.

I've been knee deep in windbg trying to get some grasp on what is going on, and still have very little. I'd by happy provide a dump or any other information that might be helpful. Obviously, there is very little information given from this particular error...

Thank you ahead of time, David Justice


A question you might ask yourself: is this ExecutionEngineException happening in IE only and, for instance, not in FireFox?

I know Silverlight is supposed to be browser-independent, but I already encountered a similar known Silverlight-issue that occured randomly in IE only.

The fact that you get an ExecutionEngineException is pointing out that the SL runtime blows up for some reason.


This exception is quite the exotic one. If one gets thrown, it's Game Over, 0 Continues for the CLR. No managed code can catch that exception.

When I ran into it, it was the result of a driver writing into a buffer that wasn't marshaled properly and so was not pinned, and the CLR moved the buffer while the driver was writing into it. It wouldn't crash instantly, but usually happened after the mouse ran over the form's menu bar (which probably resulted in creating and destroying lots of small objects, which then lead to the CLR running the GC and compacting the managed heap). Even though one of my worker threads was communicating with the driver, it was the main thread that threw the exception, which made things way more confusing.

Make sure things are being marshaled properly. If ANYTHING is being passed back and forth to unmanaged code, make sure you use GCHandle to pin the objects.

0

精彩评论

暂无评论...
验证码 换一张
取 消