Programm crasht.

07/03/2015 09:35 tschulian#1
Guten Morgen,
eines meiner Programm verabschiedet sich sporadisch mit folgendem Fehlercode:

Good Morning,
one of my programs craches with the following errorcode:

Code:
Problem signature:
  Problem Event Name:	CLR20r3
  Problem Signature 01:	test.exe
  Problem Signature 02:	1.0.0.0
  Problem Signature 03:	5591bc4d
  Problem Signature 04:	System.Data
  Problem Signature 05:	4.0.30319.17929
  Problem Signature 06:	4ffa5c76
  Problem Signature 07:	2275
  Problem Signature 08:	5e
  Problem Signature 09:	System.Data.SqlClient.Sql
  OS Version:	6.1.7601.2.1.0.256.48
  Locale ID:	1033
  Additional Information 1:	0a9e
  Additional Information 2:	0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:	0a9e
  Additional Information 4:	0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt

07/03/2015 13:37 Requi#2
Entweder lässt du jede Unhandled Exception detailiert loggen, mit dem AppDomain.Current.UnhandledException Event.
Oder du packst um die Funktion eine try catch Anweisung.

msdn Einträge:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]
07/03/2015 13:46 tschulian#3
Das habe ich auch schon gefunden, leider weiß ich eben aufgrund wenig C# Kentnisse wie ich das einbauen kann das alle unhandled exceptions gelogged werden...
07/03/2015 13:52 Requi#4
Code:
AppDomain.Current.UnhandledException += new EventHandler(LogException);

private void LogException(object sender, EventArgs e)
{
var exception = (Exception)e.ExceptionObject;
//exception hat jetzt alle nötigen daten die du brauchst.
}
war ausm kopf geschrieben falls fehler vorhanden sind.
07/03/2015 14:25 tschulian#5
Quote:
Originally Posted by Requi View Post
Code:
AppDomain.Current.UnhandledException += new EventHandler(LogException);

private void LogException(object sender, EventArgs e)
{
var exception = (Exception)e.ExceptionObject;
//exception hat jetzt alle nötigen daten die du brauchst.
}
war ausm kopf geschrieben falls fehler vorhanden sind.
OKay und diese variable muss jetzt noch in ein Textdokument geschrieben werde.
07/03/2015 14:47 Requi#6
Ich denke du wirst selbst googlen können, wie man in eine Datei schreibt und was das Object der Exception für Member hat.