2017-10-10 2 views
1

i in C# eine Windows-Anwendung mache ...wie System.AccessViolationException in System.Windows.Forms.dll aufgetreten ist?

und für das ich verwende sqlexpress für Datenbank und Krypton des Component Tools für UI-Komponenten ...

ich diese Anwendung leite auf x86 entsprechenden Plattform .. .

Anwendung funktioniert fine..but manchmal, wenn ich die Form System.AccessViolationException in System.Windows.Forms.dll kommt auf dispose ...

i <legacyCorruptedStateExceptionsPolicy enabled="true" /> in schließen app.config unde hinzugefügt r <runtime></runtime> ...

Ich habe auch [HandleProcessCorruptedStateExceptions] auf Hauptfunktion und verfügen ...

noch diese Fehler nicht gelöst ...

i ein Screenshot image..kindly am Bild sehen bin Befestigung auch ..
dank im Voraus ..

enter image description here

Antwort

2

auch wenn Sie HandleProcessCorruptedStateExceptions Attribut, Sie immer noch müssen Sie den Code in try catch

[HandleProcessCorruptedStateExceptions] 
public void TheFunction() 
{ 
    try 
    { 
     // Catch any exceptions in your code 
    } 
    catch (Exception e) 
    { 
     System.Console.WriteLine(e.Message); 
    } 
} 
+0

wickeln, die works..actually ersten i try catch hinzugefügt hatte aber setzt nicht 'HandleProcessCorruptedStateExceptions' ... mit beiden Ausnahmen gut behandelt .. –

Verwandte Themen