Skip to content

Commit e0ae629

Browse files
feat: support xml reports (#23)
* feat: support xml report uploads * chore: update Program.cs --------- Co-authored-by: Bobby Galli <bobbyg603@gmail.com>
1 parent bbf3f15 commit e0ae629

13 files changed

+567
-500
lines changed

App.config

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<configuration>
3-
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5-
</startup>
6-
<runtime>
7-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8-
<dependentAssembly>
9-
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
10-
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
11-
</dependentAssembly>
12-
<dependentAssembly>
13-
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
14-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
15-
</dependentAssembly>
16-
</assemblyBinding>
17-
</runtime>
18-
</configuration>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5+
</startup>
6+
<runtime>
7+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8+
<dependentAssembly>
9+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
11+
</dependentAssembly>
12+
<dependentAssembly>
13+
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
14+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
15+
</dependentAssembly>
16+
</assemblyBinding>
17+
</runtime>
18+
</configuration>

BugSplatCrashHandler.csproj

Lines changed: 173 additions & 171 deletions
Large diffs are not rendered by default.

CrashDialogForm.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ namespace BugSplatCrashHandler
1111
public partial class CrashDialogForm : Form
1212
{
1313
BugSplat bugsplat;
14-
MinidumpPostOptions options;
15-
FileInfo minidump;
14+
BugSplatPostOptions options;
15+
FileInfo crashReportFile;
1616
RegistryKey userCredsKey;
1717

1818

19-
public CrashDialogForm(BugSplat bugsplat, FileInfo minidump, MinidumpPostOptions options)
19+
public CrashDialogForm(BugSplat bugsplat, FileInfo crashReportFile, BugSplatPostOptions options)
2020
{
2121
this.bugsplat = bugsplat;
22-
this.minidump = minidump;
22+
this.crashReportFile = crashReportFile;
2323
this.options = options;
2424
InitializeComponent();
2525
InitializeOptions();
@@ -45,10 +45,10 @@ private void sendErrorReportButton_Click(object sender, EventArgs e)
4545
{
4646
sendErrorReportButton.Enabled = false;
4747

48-
if (File.Exists(minidump?.FullName))
48+
if (File.Exists(crashReportFile?.FullName))
4949
{
5050
var poster = new CrashPoster(bugsplat);
51-
poster.PostCrashAndDisplaySupportResponseIfAvailable(minidump, options);
51+
poster.PostCrashAndDisplaySupportResponseIfAvailable(crashReportFile, options);
5252
}
5353

5454
Application.Exit();
@@ -76,7 +76,7 @@ private void usernameTextBox_TextChanged(object sender, EventArgs e)
7676
private void viewReportDetailsButton_Click(object sender, EventArgs e)
7777
{
7878
var files = new List<FileInfo>();
79-
files.Add(minidump);
79+
files.Add(crashReportFile);
8080
files.AddRange(options.Attachments);
8181
new ReportDetailsForm(files).ShowDialog();
8282
}

CrashPoster.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ public CrashPoster (BugSplat bugsplat)
1515
this.bugsplat = bugsplat;
1616
}
1717

18-
public void PostCrashAndDisplaySupportResponseIfAvailable(FileInfo minidump, MinidumpPostOptions options)
18+
public void PostCrashAndDisplaySupportResponseIfAvailable(FileInfo crashReportFile, BugSplatPostOptions options)
1919
{
20-
var body = Task.Run(async () => {
21-
var response = await bugsplat.Post(minidump, options);
20+
var body = Task.Run(async () =>
21+
{
22+
var response = await bugsplat.Post(crashReportFile, options);
2223
var content = await response.Content.ReadAsStringAsync();
2324
return content;
2425
}).Result;
25-
2626
var json = JObject.Parse(body);
2727
var infoUrl = json["infoUrl"]?.ToString();
2828

0 commit comments

Comments
 (0)