我正在使用 Raygun.io (5.2.0) 的 Windows 10 Store 应用程序。我们发布了几次应用程序(最近一次是在 12 月中旬),我在 Rayguns 的 Web 界面中看到了来自以前版本的日志。在发布下一个版本之前测试应用程序时,我发现如果应用程序是使用 .NET 本机工具链构建的,则在发送异常时 Raygun 不再工作(= 崩溃)。我可以在一个简单的 UWP 测试应用程序中重现这一点:
public sealed partial class MainPage : Page
{
//private readonly RaygunClient _raygunClient;
public MainPage()
{
InitializeComponent();
RaygunClient.Attach("<app_key>");
//_raygunClient = new RaygunClient("<app_key>");
}
private async void OnClick(object sender, RoutedEventArgs e)
{
try
{
// this is crashing the app when project is build using .NET native toolchain
// it is not even throwing exception
//await _raygunClient.SendAsync(new InvalidOperationException("Raygun Test"));
await RaygunClient.Current.SendAsync(new InvalidOperationException("Raygun Test")); // (1)
Status.Text = "Ok";
}
catch (Exception exception) // (2)
{
Status.Text = $"Failed with {exception.Message}";
}
}
}
检查https://github.com/MindscapeHQ/raygun4net支持的平台/框架,它似乎不明确支持 UWP。
更新:应用程序在第 (1) 行之后被杀死,在 (2) 处没有异常在事件视图中我可以看到:
Faulting application name: rayguntest.exe, version: 1.0.0.0, time stamp: 0x56a0edc9
Faulting module name: mrt100_app.dll, version: 1.0.23406.0, time stamp: 0x561408ce
Exception code: 0x80000003
Fault offset: 0x000000000000a0ad
Faulting process id: 0x305c
Faulting application start time: 0x01d1545a0fea5649
Faulting application path: C:\Projects\rayguntest\rayguntest\bin\x64\Release\AppX\rayguntest.exe
Faulting module path: C:\Program Files\WindowsApps\Microsoft.NET.Native.Runtime.1.1_1.1.23406.0_x64__8wekyb3d8bbwe\mrt100_app.dll
Report Id: 52bbeeb5-97c6-4814-b5dc-51ee6c3fa9bd
Faulting package full name: 6ca59c51-ed22-482b-acf6-12d241079f4d_1.0.0.0_x64__1d8r4kqm7qz2y
Faulting package-relative application ID: App