Silverlight throws AccessViolationException - by HHristov

Status : 


Sign in
to vote
ID 719572 Comments
Status Active Workarounds
Type Bug Repros 38
Opened 1/20/2012 4:55:14 AM
Access Restriction Public


We found a problem in the Silverlight runtime. When we set Text property on a inherited TextBox which is unloaded then Silverlight throws an exception.

The problem seems to be related to the fact that TextBox is inherited and Foreground property which is animated using storyboard from a visual state.

There are two attachments - one with the project that could be used to reproduce the bug and the other one is a video demonstrating the problem.
Sign in to post a comment.
Posted by Microsoft on 4/29/2014 at 12:24 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from:
Posted by Microsoft on 7/15/2013 at 1:21 PM
Thank you for identifying this issue. We have fixed the problem, and the change is included in Silverlight 5 GDR3, released as part of MS13-052/KB2847559. You may download this fix at We are deeply appreciative for your commitment to help us build better products, and we hope this fix improves your experience with our tools and technologies.

The Silverlight Team
Posted by Aligned on 5/11/2012 at 7:40 AM
According to the release notes for the latest release, this has been resolved. Is that correct?
Posted by teyc on 4/15/2012 at 11:37 PM
I've provided another stack trace. In my case, I had a ComboBox inside a DataForm (wired up to Kyle McClellan's ComboBoxDataSource in Async mode). Upon changing the SelectedValue, AccessViolation is thrown. From the stack trace, it looks like a problem rebuilding the visual tree.
Posted by Hardaar on 4/3/2012 at 9:43 AM
Huge issue in our large business application when merging from SL4 -> SL5. See a workaround I added as it seems TextHinting could potentially be the big culprit in causing these to happen, as when I took it out in a part where it happened every time (100% reproducible) it stopped throwing these exceptions.
Posted by Jason Rosenthal on 3/28/2012 at 8:49 AM
I'm devistated by this problem as well. I'm not sure why the Silverlight team choose to relpace ver 4 with 5. Insead of running incompatible versions side by side. I haven't seen this type of problem since switching to .net from COM.
Posted by SoonerGoose on 3/27/2012 at 7:17 AM
My issue came with the adoption of the SL5 Runtime and using DataForm and the ReadOnlyTemplate template. To make the UI look the same from ReadOnlyTemplate to EditTemplate I use Textboxes for both but in the ReadOnlyTemplate the Textboxes are set to IsReadOnly="True". Then when I go to the EditTemplate by putting the DataForm in Edit mode and changed one of the Textbox's Text field it would throw the AccessViolationException in the NotifyPropertyChanged event. To fix this issue I put the IsReadOnly into a style and set this style in the TextBox. List so <TextBox Text="{Binding Name}" Style="{StaticResource ReadOnlyTextBoxStyle}" />. This fixed the initial issue. Next issue was putting the DataForm into edit mode, editting a TextBox, hitting cancel, put the DataForm back into edit mode and edit the TextBox again and the AccessViolationException popped up again in the NotifyPropertyChanged event. To fix this I requery the database on cancel. Not only does this keep the data fresh but it fixed the second issue I was having. Hope this helps anyone else having the same issue.
Posted by Adamoaragato on 3/13/2012 at 12:52 PM
This bug is very quirky. It does not happen all the time, but it happens consistently when I follow a certain work flow. More specifically, it happens when I switch tabs in a Telerik RadTabControl in Sliverlight.
Posted by Hugo86 on 3/8/2012 at 1:35 AM
We are having the same issue with SL5. What is the Status on this BUG?
Can we expect a fix in the near future?
Posted by eqs on 2/27/2012 at 11:03 AM
I wonder if this bug is really UI related, because any kind of NotifyPropertyChanged or RaiseDataMemberChanged can cause this bug. Except that it happens so randomly that it is impossible trace down.
Posted by PN Gandhi on 2/1/2012 at 1:23 AM
If we run our application in SL4 than its work fine. But if we run on SL5 than in some screens than "System.AccessViolationException: Attempted to read or write protected memory." error comes. Its a really big issue. If our end users get this error than we need to ask them to remove SL5 and install SL4 runtime.
Posted by MikeCousins on 1/25/2012 at 2:55 PM
Big issue for us. Our application is crashing all over the place for anybody using the Silverlight 5 runtime.
Posted by MS-Moderator07 [Feedback Moderator] on 1/22/2012 at 6:15 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 1/20/2012 at 5:43 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(