ClrMD on another user's process

不想你离开。 提交于 2019-12-12 02:43:16

问题


I have a .Net application that's reporting hangs in the Event Log. The events say "Application Hang" with no usable details to go by.

So I whipped up a C# console app that uses the ClrMD library. But the caveat is this application is being published as a RemoteApp. When I try to attach ClrMD to the users' process I get this error: Microsoft.Diagnostics.Runtime.ClrDiagnosticsException: Could not attach to process. Error 0.

This is not surprising since I'm logged into the server as Administrator and they are in their own RDP session with a different user.

So then I decided to impersonate the user they are logged in as thinking if I run my ClrMD app as them, it will have access to that process. This gave me a different error: Microsoft.Diagnostics.Runtime.ClrDiagnosticsException: Could not attach to process. Error 1008.

I can't seem to find any clues as to what 1008 means to know where to go from here. I realize I'm probably trying to do something that's not possible.

  1. Has anyone gotten ClrMD to attach to another user's process?
  2. If not, are there are debug tools out there that can attach to other users' processes?
  3. If not, have people used ClrMD in within production and how would I know the app is hung to know when to trigger a ClrMD dump? Just monitor the UI thread in another background thread?

回答1:


Had / have same issue. Running elevated as admin on a server via a console app didn't work. But it does work if run through PowerShell or Visual Studio itself with elevated permissions. The debugger requires Admin privs to connect live. Adding a manifest, etc didn't seem to help when running as a console.



来源:https://stackoverflow.com/questions/31946610/clrmd-on-another-users-process

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!