I keep having this error sometimes in a particular case. It happens precisely when I am switching from a visual state to another. I assume it comes from a bad property animation but I wonder what are the conditions in which this exception occurs. Here is the error message:
The runtime has encountered a fatal error. The address of the error was at 0x58e3ba0d, on thread 0xabc. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
Thank you in advance
I think I found the explanation: During state transition, I was trying to collapse parts of the UI. Among these parts, there are some controls (buttons) that have several behaviors attached.
After some tests I noticed that collapsing a control that has a behavior attached seems to throw an exception. Collapsing deletes the reference to the object and the attached behavior is left with a null reference that makes it throwing an exception. I don't know precisely what's happening, but I am pretty sure this is the cause. It seems to happen also with "hidden" visibility. So the only workaround I found for the moment is reducing the opacity of the control et setting its height to 0.
If someone found a better way to avoid this problem...
User contributions licensed under CC BY-SA 3.0