gpt4 book ai didi

c# - Xamarin AppCenter Crashes.TrackError 没有显示我在 AppCenter 中期望的详细信息

转载 作者:行者123 更新时间:2023-12-05 03:01:00 25 4
gpt4 key购买 nike

我有这个代码:

    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 个字符的限制是否适用于异常本身。

其次,如果不查看单个错误报告,您将看不到太多数据。查看特定实例 -

  1. 点击左侧导航栏中的“诊断”
  2. 选择您要检查的错误
  3. 在顶部附近,选择“报告”,这会显示带有时间戳的各个实例
  4. 选择一个实例
  5. 在底部附近,您会看到一个标题为“错误属性”的区域,该区域应显示您包含在错误中的字典数据。

关于c# - Xamarin AppCenter Crashes.TrackError 没有显示我在 AppCenter 中期望的详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56323801/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com