Xamarin AppCenter Crashes.TrackError 没有显示我在 AppCenter 中期望的详细信息
Xamarin AppCenter Crashes.TrackError not showing details I expect in AppCenter
我有这个代码:
private async void ChangeTheColours(Object sender, EventArgs e)
{
try
{
if ((string)this.ButtonLabel.Text.Substring(0, 1) != " ")
{
ConfigureColors((Button)sender, "C");
await Task.Delay(200);
ConfigureColors((Button)sender, State);
}
}
catch (Exception ex)
{
Crashes.TrackError(ex,
new Dictionary<string, string> {
{"ChangeTheColours", "Exception"},
{"Device Name", DeviceInfo.Name },
{"Device Model", DeviceInfo.Model },
});
}
}
出现异常,我期待看到 ex 字符串(不止几个字)、设备名称和型号等信息。
但 AppCenter 只告诉我:
Stack traces Button.ChangeTheColours (System.Object sender,
System.EventArgs e) Templates/Button/Button.xaml.cs:83
并且没有提供有关异常或设备名称和型号的更多信息。
我在尝试检测此类崩溃时是否做错了什么?请注意,我意识到通常需要抛出异常,但这是此错误的特例。
两件事。首先,我认为 this page 可以解释为什么您的异常消息被缩短了一点。我不太确定 125 个字符的限制是否适用于异常本身。
其次,如果不查看单个错误报告,您将看不到太多数据。查看特定实例 -
- 单击左侧导航中的 "Diagnostics"
- Select 您尝试检查的错误
- 靠近顶部,select "Reports",这显示了具有时间戳的各个实例
- Select一个实例
- 在底部附近,您会看到一个标题为 "Error Properties" 的区域,该区域应显示您在错误中包含的字典数据。
我有这个代码:
private async void ChangeTheColours(Object sender, EventArgs e)
{
try
{
if ((string)this.ButtonLabel.Text.Substring(0, 1) != " ")
{
ConfigureColors((Button)sender, "C");
await Task.Delay(200);
ConfigureColors((Button)sender, State);
}
}
catch (Exception ex)
{
Crashes.TrackError(ex,
new Dictionary<string, string> {
{"ChangeTheColours", "Exception"},
{"Device Name", DeviceInfo.Name },
{"Device Model", DeviceInfo.Model },
});
}
}
出现异常,我期待看到 ex 字符串(不止几个字)、设备名称和型号等信息。
但 AppCenter 只告诉我:
Stack traces Button.ChangeTheColours (System.Object sender, System.EventArgs e) Templates/Button/Button.xaml.cs:83
并且没有提供有关异常或设备名称和型号的更多信息。
我在尝试检测此类崩溃时是否做错了什么?请注意,我意识到通常需要抛出异常,但这是此错误的特例。
两件事。首先,我认为 this page 可以解释为什么您的异常消息被缩短了一点。我不太确定 125 个字符的限制是否适用于异常本身。
其次,如果不查看单个错误报告,您将看不到太多数据。查看特定实例 -
- 单击左侧导航中的 "Diagnostics"
- Select 您尝试检查的错误
- 靠近顶部,select "Reports",这显示了具有时间戳的各个实例
- Select一个实例
- 在底部附近,您会看到一个标题为 "Error Properties" 的区域,该区域应显示您在错误中包含的字典数据。