6

Abbiamo aggiornato il nostro progetto da Silverlight 4 a Silverlight 5 e ora stiamo vivendo AccessViolationException di volta in volta in diversi punti del codice, questa eccezione causa anche il blocco del browser .Aggiornamento da Silverlight 4 a Silverlight 5 causando AccessViolationException

Esiste qualche linea guida su come impedire che ciò accada?

sto aggiungendo l'analisi dello stack in cui la AccessViolationException era spuntato:

[Managed to Native Transition] 
System.Windows.dll!MS.Internal.XcpImports.SetValue(MS.Internal.IManagedPeerBase obj, System.Windows.DependencyProperty property, string s) + 0x6f bytes 
System.Windows.dll!MS.Internal.XcpImports.SetValue(MS.Internal.IManagedPeerBase doh, System.Windows.DependencyProperty property, object obj) + 0x2ce bytes 
System.Windows.dll!System.Windows.DependencyObject.SetObjectValueToCore(System.Windows.DependencyProperty dp, object value) + 0xd6 bytes 
System.Windows.dll!System.Windows.DependencyObject.SetEffectiveValue(System.Windows.DependencyProperty property, ref System.Windows.EffectiveValueEntry newEntry, object newValue) + 0x35 bytes 
System.Windows.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.DependencyProperty property, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, System.Windows.DependencyObject.ValueOperation operation) + 0xe6 bytes 
System.Windows.dll!System.Windows.DependencyObject.RefreshExpression(System.Windows.DependencyProperty dp) + 0x47 bytes 
System.Windows.dll!System.Windows.Data.BindingExpression.SendDataToTarget() + 0xff bytes 
System.Windows.dll!System.Windows.Data.BindingExpression.SourceAcquired() + 0x5f bytes 
System.Windows.dll!System.Windows.Data.Debugging.BindingBreakPoint.BreakOnSharedType.AnonymousMethod__3() + 0x14 bytes 
[Native to Managed Transition] 
[Managed to Native Transition] 
mscorlib.dll!System.Delegate.DynamicInvokeImpl(object[] args) + 0x6b bytes 
mscorlib.dll!System.Delegate.DynamicInvoke(object[] args) + 0xb bytes 
BindingDebugging!TextPropertyPanelxaml_5.BindingOperation(object BindingState) + 0x30 bytes 
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.dll!System.Windows.Data.Debugging.BindingBreakPoint.BreakOnSharedType(System.Type emittedType, System.Windows.Data.Debugging.BindingDebugState debugState, int bindingNumber, int line, int column, System.Action callback) + 0xd5 bytes 
System.Windows.dll!System.Windows.Data.Binding.EnsureBreakPoint(System.Windows.Data.Debugging.BindingDebugState debugState, System.Action callback, bool canDelay) + 0x1ff bytes 
System.Windows.dll!System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(object sender, System.Windows.DataContextChangedEventArgs e) + 0xa4 bytes 
System.Windows.dll!System.Windows.Data.BindingExpression.DataContextChanged(object sender, System.Windows.DataContextChangedEventArgs e) + 0xc bytes 
System.Windows.dll!System.Windows.FrameworkElement.OnDataContextChanged(System.Windows.DataContextChangedEventArgs e) + 0x1e bytes 
System.Windows.dll!System.Windows.FrameworkElement.OnAncestorDataContextChanged(System.Windows.DataContextChangedEventArgs e) + 0x26 bytes 
System.Windows.dll!System.Windows.FrameworkElement.NotifyDataContextChanged(System.Windows.DataContextChangedEventArgs e) + 0xcb bytes 
System.Windows.dll!System.Windows.FrameworkElement.OnAncestorDataContextChanged(System.Windows.DataContextChangedEventArgs e) + 0x32 bytes 
System.Windows.dll!System.Windows.FrameworkElement.NotifyDataContextChanged(System.Windows.DataContextChangedEventArgs e) + 0xcb bytes 
System.Windows.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyProperty dp) + 0x47 bytes 
System.Windows.dll!System.Windows.DependencyObject.RaisePropertyChangeNotifications(System.Windows.DependencyProperty dp, object oldValue, object newValue) + 0x5e bytes 
System.Windows.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.DependencyProperty property, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, System.Windows.DependencyObject.ValueOperation operation) + 0xf3 bytes 
System.Windows.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty dp, object value, bool allowReadOnlySet, bool isBindingInStyleSetter) + 0x248 bytes 
System.Windows.dll!System.Windows.FrameworkElement.DataContext.set(object value) + 0x28 bytes 
ContentManagerSilverlight!ContentManagerSilverlight.TextPropertyPanel.set_ItemDetails(ContentManagerClientTypes.ServiceLibrary.ItemDetails value) Line 132 + 0xd bytes 
ContentManagerSilverlight!ContentManagerSilverlight.PropertiesPanelControl.SetPanelsVisability(ContentManagerClientTypes.ServiceLibrary.ItemDetails p_item) Line 78 + 0x1f bytes 
ContentManagerSilverlight!ContentManagerSilverlight.PropertiesPanelControl.HandleEvents(Object p_sender, String p_propertyName, Object p_propertyValue) Line 130 + 0x35 bytes 
ContentManagerClientTypes!ContentManagerClientTypes.Messenger.Send(Object p_sender, String p_propertyName, Object p_propertyValue) Line 34 + 0x55 bytes 
ContentManagerSilverlight!ContentManagerSilverlight.LibraryViewModel.set_SelectedItemDetails(ContentManagerClientTypes.ServiceLibrary.ItemDetails value) Line 181 + 0x25 bytes 
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.dll!System.Windows.CLRPropertyListener.Value.set(object value) + 0x23 bytes 
System.Windows.dll!System.Windows.PropertyAccessPathStep.Value.set(object value) + 0xe bytes 
System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValue() + 0x692 bytes 
System.Windows.dll!System.Windows.Data.Debugging.BindingBreakPoint.BreakOnSharedType.AnonymousMethod__3() + 0x14 bytes 
[Native to Managed Transition] 
[Managed to Native Transition] 
mscorlib.dll!System.Delegate.DynamicInvokeImpl(object[] args) + 0x6b bytes 
mscorlib.dll!System.Delegate.DynamicInvoke(object[] args) + 0xb bytes 
BindingDebugging!LibraryThumbViewxaml.BindingOperation(object BindingState) + 0x30 bytes 
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.dll!System.Windows.Data.Debugging.BindingBreakPoint.BreakOnSharedType(System.Type emittedType, System.Windows.Data.Debugging.BindingDebugState debugState, int bindingNumber, int line, int column, System.Action callback) + 0xd5 bytes 
System.Windows.dll!System.Windows.Data.Binding.EnsureBreakPoint(System.Windows.Data.Debugging.BindingDebugState debugState, System.Action callback, bool canDelay) + 0x1ff bytes 
System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValueEnsureBreak() + 0x53 bytes 
System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValueIfNecessary() + 0x68 bytes 
System.Windows.dll!System.Windows.Data.BindingExpression.TargetPropertyChanged(System.Windows.DependencyObject sender, System.Windows.DependencyProperty dp) + 0x2b bytes 
System.Windows.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyProperty dp) + 0x16 bytes 
System.Windows.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyProperty dp) + 0x54 bytes 
System.Windows.dll!System.Windows.Controls.Primitives.Selector.OnPropertyChanged(System.Windows.DependencyProperty dp) + 0x13 bytes 
System.Windows.dll!System.Windows.DependencyObject.RaisePropertyChangeNotifications(System.Windows.DependencyProperty dp, object oldValue, object newValue) + 0x5e bytes 
System.Windows.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.DependencyProperty property, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, System.Windows.DependencyObject.ValueOperation operation) + 0xf3 bytes 
System.Windows.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty dp, object value, bool allowReadOnlySet, bool isBindingInStyleSetter) + 0x1c9 bytes 
System.Windows.dll!System.Windows.Controls.Primitives.Selector.UpdatePublicSelectionProperties(int oldSelectedIndex, int newSelectedIndex, object oldSelectedItem, object newSelectedItem) + 0xca bytes 
System.Windows.dll!System.Windows.Controls.Primitives.Selector.SelectionChanger.End() + 0x172 bytes 
System.Windows.dll!System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(int oldIndex, int newIndex) + 0x170 bytes 
System.Windows.dll!System.Windows.Controls.ListBox.MakeSingleSelection(int index) + 0x3e bytes 
System.Windows.dll!System.Windows.Controls.ListBox.HandleItemSelection(System.Windows.Controls.ListBoxItem item, bool isMouseSelection) + 0x7a bytes 
System.Windows.dll!System.Windows.Controls.ListBox.OnListBoxItemClicked(System.Windows.Controls.ListBoxItem item) + 0x7 bytes 
System.Windows.dll!System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e) + 0x54 bytes 
System.Windows.dll!System.Windows.Controls.Control.OnMouseLeftButtonDown(System.Windows.Controls.Control ctrl, System.EventArgs e) + 0x38 bytes 
System.Windows.dll!MS.Internal.JoltHelper.FireEvent(System.IntPtr unmanagedObj, System.IntPtr unmanagedObjArgs, int argsTypeIndex, int actualArgsTypeIndex, string eventName, uint flags) + 0x28f bytes 
[Appdomain Transition] 
+1

Non è una risposta reale, quindi inserisco questo nei commenti. Ma sembra che tu non sia solo: http://stackoverflow.com/questions/8495242/silverlight-5-accessviolationexception, http://forums.silverlight.net/t/245247.aspx/1, ... – Peter

+0

I sto ancora combattendo con questo. Riesci a riprodurre questo? Non sono in grado di farlo accadere al di fuori del mio progetto. – Aligned

+0

Stai usando i controlli di Telerik? Hanno riparato una occorrenza di questo (ho seguito alcuni collegamenti, copiando queste informazioni qui). – jv42

risposta

0

La mia ipotesi è che è un'installazione di runtime difettosa, o il browser antivirus add-on o.

Risoluzione dei problemi in questo modo:

  1. Cosa significa ceppi DrWatson mostrano? Tess Ferrandez ha molte informazioni su come leggere i registri degli arresti anomali. O pubblica qui il registro degli arresti anomali.
  2. Accade con diversi browser?
  3. È possibile disattivare gli add-on?
  4. Accade su tutti i computer?
  5. La tua app utilizza un'automazione COM o PInvoke?
+2

Questo errore riappare su computer diversi (oltre 2) e su diversi browser. –

+0

Si prega di inviare il registro di arresto anomalo. –

+0

Ho anche allegato una schermata alla qustion, ma questo è quello che ottengo come eccezione. System.AccessViolationException non gestito Messaggio = Tentativo di leggere o scrivere memoria protetta. Questo è spesso un'indicazione che un'altra memoria è corrotta. InnerException: –

3

Ho trovato una fonte del problema (non sono sicuro che abbia risolto tutti questi problemi di AccessViolationException), ma il mio sistema ora è molto più stabile.

A quanto pare l'uso di Bureau Black Theme dall'ultimo toolkit, con la combinazione di TextBox, ha causato questo problema.

Quello che ho fatto per risolverlo è quello di ricompilazione questo tema senza lo stile del controllo TextBox e l'emissione di AccessViolation è scomparso, in questa fase non abbiamo fatto test profondo su tutto il sistema, ma questo è risolvere un problema che potrei riprodurre rapidamente, quindi presumo che questo potrebbe aver risolto più problemi del genere.

Spero che abbia aiutato qualcuno.

saluti,

Lior

2

Ok, ho trovato una soluzione. Precedentemente avevo gli stili di applicazione/set di temi generali nel file Mainpage.xaml - e il tema si rifletteva su tutte le pagine di navigazione figlio in fase di runtime. questo stava causando il problema in qualche modo.

Se imposto esplicitamente lo stile in base pagina per pagina, tutto funziona !!

Così: (usando il toolkit tema BureauBlue)

xmlns:SystemColors="clr-namespace:System.Windows.Controls.Theming;  assembly=System.Windows.Controls.Theming.BureauBlue" 

<SystemColors:BureauBlueTheme> 
    <Grid x:Name="LayoutRoot"> 

. . .

1

L'uso del Bureau Blu provoca anche lo stesso System.AccessViolationException quando si aggiorna una proprietà legata a una casella di testo.

Il work-around che ha funzionato per me è stato copiare lo stile TextBox dalla dll Theme in un ResourceDictionary che è fuso nel dizionario delle risorse App.xaml. Facendo questo evitato di dover specificare il tema su ogni vista.

I temi che sto utilizzando provengono dal toolkit di aprile 2010. Non so se una successiva versione del toolkit potrebbe aver risolto il problema.