简体   繁体   English

如何在Visual Studio 2017中调试.net dmp文件

[英]Howto debug a .net dmp file in visual studio 2017

My service which is implemented as a windows service crashes on a customer server every 2 weeks +- some days. 我的服务是Windows服务,每隔2周+-几天会在客户服务器上崩溃。

  • The service is written in .net (vb.net/c#) 该服务以.net(vb.net/c#)编写
  • Compiled for any-cpu 为任何CPU编译
  • Without prefer 32bit 不喜欢32位
  • .net Framework 4.5.2 .net Framework 4.5.2
  • Runs on a server with 64bit cpu 在具有64位CPU的服务器上运行
  • Visual Studio is 2017 Professional Visual Studio是2017专业版

Since i'm unable to reproduce the problem, i want to debug the dump file. 由于我无法重现该问题,因此我想调试转储文件。

I did setup user-mode dumps on the server based on https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 我确实根据https://msdn.microsoft.com/zh-cn/library/windows/desktop/bb787181%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396在服务器上设置了用户模式转储

The following picture shows how i have configured the user-mode dump in the registry: 下图显示了如何在注册表中配置用户模式转储: 在此处输入图片说明

I can open this dump, but the only information i get is 我可以打开此转储,但我得到的唯一信息是

The thread tried to read from or write to a virtual address for which it does not have the appropriate access. 线程尝试从其没有适当访问权限的虚拟地址读取或写入虚拟地址。 在此处输入图片说明

If i then start debugging (Managed Only, Mixed and Native Only), the following error is shown: 如果随后我开始调试(仅受管,混合和仅本机),则会显示以下错误:

Unhandled exception at 0x000007FEF3FB09AF (clr.dll) in FooService.exe.3616.dmp: 0xC0000005: Access violation reading location 0x0000000000000000. FooService.exe.3616.dmp中的0x000007FEF3FB09AF(clr.dll)处未处理的异常:0xC0000005:访问冲突读取位置0x0000000000000000。 在此处输入图片说明

Any hint what i need to do in order to get more information out of the .dmp file? 任何提示我需要做什么才能从.dmp文件中获取更多信息?

I guess i do now understand (more or less). 我想我现在了解了(或多或少)。

I did not save the pdb files used during the compilation of the release mode files, and tried to recreate those pdb files based on the same source, and this seems not to work for debugging the minidump in visual studio. 我没有保存在发行模式文件的编译过程中使用的pdb文件,而是尝试基于同一源重新创建这些pdb文件,这似乎无法在Visual Studio中调试minidump。

But with the Debug Diagnostic Tool v2 Update 2 from from microsoft, i was able to get the Stack Trace of the exception based on my already existent minidump, and i'm now able to locate the error. 但是,借助来自Microsoft的Debug Diagnostic Tool v2 Update 2 ,我可以基于已经存在的minidump获取异常的堆栈跟踪,并且现在可以找到错误。

I still don't understand why visual studio can't show the same information. 我仍然不明白为什么Visual Studio无法显示相同的信息。

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

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