简体   繁体   English

是否有支持混合 C++ 和 C# 应用程序的崩溃报告服务?

[英]Is there a crash reporting service that supports mixed C++ and C# applications?

I am currently using the Windows Error Reporting service that is built into the Windows OS.我目前正在使用 Windows 操作系统中内置的 Windows 错误报告服务。 It falls short in quite a few areas including automating new builds being submitted for crash collection and analysis of the actual crashes.它在很多领域都存在不足,包括自动化提交用于崩溃收集和实际崩溃分析的新构建。

I found a few options including Dr Dump and CrashRpt for C++ applications.我找到了一些选项,包括用于 C++ 应用程序的Dr DumpCrashRpt

The most appealing option that I found though was HockeyApp .我发现最吸引人的选项是HockeyApp My team already uses HockeyApp for hosting mobile applications as well as builds of our desktop applications.我的团队已经使用 HockeyApp 来托管移动应用程序以及构建我们的桌面应用程序。 Plus, it just seems more well-supported and feature-rich than other services.此外,它似乎比其他服务更受支持且功能更丰富。 It seems to only support crash reports for .NET applications.它似乎只支持 .NET 应用程序的崩溃报告。

The application that I am trying to gather crash reports for is a mixed C++ and C# application though.不过,我尝试为其收集崩溃报告的应用程序是混合的 C++ 和 C# 应用程序。 I'm not sure if there is a crash reporting service out there that can handle both languages.我不确定是否有可以处理两种语言的崩溃报告服务。

Without going into immense detail, my application is mostly .NET wrapped up in a native C++ application.无需详细说明,我的应用程序主要是包含在本机 C++ 应用程序中的 .NET。 I'm assuming that this means I need a service to support C++ crash reporting.我假设这意味着我需要一个服务来支持 C++ 崩溃报告。

To summarize:总结一下:

  1. If my applications is mostly .NET based, but wrapped up in a native C++ appliaction, do I need a crash reporting service that just supports C++ applications?如果我的应用程序主要基于 .NET,但包含在本机 C++ 应用程序中,我是否需要仅支持 C++ 应用程序的崩溃报告服务?
  2. Is there a crash reporting service that supports applications with mixed C++ and C# code?是否有支持使用混合 C++ 和 C# 代码的应用程序的崩溃报告服务?

Those tools have a disadvantage: they use the Unhandled Exception Handling mechanism and live in your process.这些工具有一个缺点:它们使用未处理的异常处理机制并存在于您的进程中。 If your application gets corrupted, you can no longer rely on things to work.如果您的应用程序损坏,您就不能再依赖其他东西来工作了。 I had that case in VB6, where the VB6 runtime was destroyed and no unhandled exception handler could help me.我在 VB6 中遇到过这种情况,其中 VB6 运行时被破坏并且没有未处理的异常处理程序可以帮助我。

That's also why WER (Windows Error Reporting) exists.这也是 WER(Windows 错误报告)存在的原因。 While your process is dying, Windows itself still works pretty fine.虽然您的进程快要死了,但 Windows 本身仍然运行良好。 And perhaps you can benefit from its features, too: the WER LocalDumps Registry Key也许您也可以从它的功能中受益: WER LocalDumps 注册表项

Set this Registry key during the installation of your product and it will save crash dumps into a folder.在您的产品安装期间设置此注册表项,它会将故障转储保存到一个文件夹中。 When your application starts up next time, you can do with them whatever you want (maybe ask for the user's permission):当您的应用程序下次启动时,您可以随心所欲地使用它们(可能需要获得用户的许可):

  • analyze the crash dump (eg using ClrMd) and send some exception details to you分析故障转储(例如使用 ClrMd)并向您发送一些异常详细信息
  • shrink the crash dump and send the shrunken one to you.缩小故障转储并将缩小的一个发送给您。 (Convert a full memory .NET dump into a small minidump) (将全内存 .NET 转储转换为小型小型转储)
  • upon request ask the user to send the full crash dump to you根据要求,要求用户将完整的故障转储发送给您
  • don't forget some clean up不要忘记一些清理

All in all I would say it's not hard to do.总而言之,我会说这并不难。 Might be a good project for students.对学生来说可能是一个很好的项目。 Pro: you don't need to care about all that crash handling, pointer mangling etc., because WER does it for you.优点:你不需要关心所有的崩溃处理、指针修改等,因为 WER 为你做了。 You can't really mess it up.你不能真的搞砸了。

Oh, and when you build that, consider building it as a reusable component and make it open source on Github.哦,当你构建它时,考虑将它构建为一个可重用的组件,并在 Github 上开源。 I would need that, too.我也需要那个。 You can't get a patent any more, because with this post I will claim "prior art" :-)你不能再获得专利了,因为在这篇文章中,我将声称“现有技术”:-)

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

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