Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

Commit aed69e7

Browse files
committed
catch crashes
1 parent 1a23e1b commit aed69e7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

csharp/source/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@ static void Main()
2020
// do not store the app secret on source code
2121
// this is only for demo purposes
2222
System.Console.WriteLine("App Center Powered.");
23+
// this will track exceptions on crash
24+
Application.ThreadException += (sender, args) =>
25+
{
26+
Crashes.TrackError(args.Exception);
27+
};
28+
// this will start the App Center SDK
2329
AppCenter.Start("{Your App Secret}", typeof(Analytics), typeof(Crashes));
30+
// this will setup the callbacks for C++
2431
AppCenterCpp.setup();
32+
// this will initialize the C++ app
2533
AppCenterCpp.initApp();
2634
}
27-
35+
2836
}

0 commit comments

Comments
 (0)