Skip to main content

Microsoft Silverlight

Answered Question RC0 System.ExecutionEngineExceptionRSS Feed

(0)

Mike4268
Mike4268

Member

Member

24 points

29 Posts

RC0 System.ExecutionEngineException

I have an object in my silverlight application that I press the delete key on. This calls a javascript function:

HtmlPage.Window.Invoke("DeleteAnnotationsById", ids))

The first thing the javascript function does is to call

confirm("Are you sure you want to delete this annotation?");

A System.ExecutionEngineException is then thrown and IE7 crashes. This worked in beta2. Any ideas? :)

Gondor
Gondor

Member

Member

157 points

31 Posts

Answered Question

Re: RC0 System.ExecutionEngineException

Maybe this?

 From the 'Breaking Changes' document.

KeyDown Sent Synchronously

Who Is Affected: If you previously have been doing operations in the KeyDown event that could cause reentrancy into the Silverlight control, such as calling into the HtmlPage.Window.Alert function, this will no longer be supported.

Summary

We switched over our keyboard handling for character input to use the concept of the WM_CHAR windows message. This is used for TextBox/PasswordBox text entry to enable scenarios such as entering AltGr keystrokes. In order for us to do this, the KeyDown event had to be sent synchronously for managed code.  

 

Mike4268
Mike4268

Member

Member

24 points

29 Posts

Re: Re: RC0 System.ExecutionEngineException

I found another forum post about a similar problem and got it to work like this:

this.Dispatcher.BeginInvoke(new AsyncDelete(deleteFunction), new object[]{ids});
public delegate void AsyncDelete(object obj);
public void deleteFunction(object obj)
{
HtmlPage.Window.Invoke("DeleteAnnotationsById", (string)obj);
}


http://silverlight.net/forums/p/22311/78612.aspx

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities