简体   繁体   English

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

[英]Xamarin AppCenter Crashes.TrackError not showing details I expect in AppCenter

I have this code: 我有以下代码:

    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 },
                });
        }
    }

There was an exception and I was expecting to see information such as the ex string (more than a few words), Device Name and Model. 有一个例外,我期望看到诸如ex字符串(不止几个字),设备名称和型号之类的信息。

But AppCenter only tells me: 但是AppCenter只告诉我:

Stack traces Button.ChangeTheColours (System.Object sender, System.EventArgs e) Templates/Button/Button.xaml.cs:83 堆栈跟踪Button.ChangeTheColours(System.Object发件人,System.EventArgs e)Templates / Button / Button.xaml.cs:83

and doesn't give any more information about the exception or the Device Name and Model. 并且不提供有关异常或设备名称和型号的更多信息。

Is there something I am doing incorrectly with trying to detect crashes like this? 我在尝试检测像这样的崩溃时是否做错了什么? Note that I realise a throw would normally be needed but this is a special case for this error. 请注意,我意识到通常会需要抛出异常,但这是此错误的一种特殊情况。

Couple things. 夫妻的事。 First, I think that this page might explain why your exception message is cut a little short. 首先,我认为该页面可以解释为什么您的异常消息会被缩短一些。 I'm not quite sure if the 125 character limit applies to the exception itself. 我不太确定125个字符的限制是否适用于异常本身。

Second, you don't see much data without looking at the individual error report. 其次,不查看单个错误报告,您不会看到太多数据。 To view a specific instance - 要查看特定实例-

  1. Click "Diagnostics" in the left nav 点击左侧导航栏中的“诊断”
  2. Select the Error you are trying to inspect 选择您要检查的错误
  3. Near the top, select "Reports", this shows the individual instances with timestamps 在顶部附近,选择“报告”,这将显示带有时间戳的各个实例
  4. Select an instance 选择一个实例
  5. Near the bottom, you will see an area titled "Error Properties" that should show your dictionary data you included in your error. 在底部附近,您将看到一个标题为“错误属性”的区域,该区域应显示您包含在错误中的字典数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM