ClrMD关于另一个用户的进程 [英] ClrMD on another user's process
问题描述
我有一个报告的.Net应用程序挂在事件日志中.这些事件显示应用程序挂起",没有可用的详细信息.
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.
因此,我整理了一个使用ClrMD库的C#控制台应用程序.但是需要注意的是,此应用程序已作为RemoteApp发布.当我尝试将ClrMD附加到用户的进程时,出现此错误: Microsoft.Diagnostics.Runtime.ClrDiagnosticsException:无法附加到进程.错误0.
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.
这并不奇怪,因为我以管理员身份登录服务器,并且他们与其他用户处于各自的RDP会话中.
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.
因此,我决定假扮他们登录的用户,以为如果我像他们一样运行我的ClrMD应用程序,它将可以访问该进程.这给了我一个不同的错误: Microsoft.Diagnostics.Runtime.ClrDiagnosticsException:无法附加到进程.错误1008.
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.
对于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.
- 是否有人将ClrMD附加到另一个用户的进程上?
- 如果没有,是否有可以附加到其他用户进程的调试工具?
- 如果没有,人们是否在生产中使用了ClrMD,我怎么知道该应用挂了以了解何时触发ClrMD转储?只是在另一个后台线程中监视UI线程?
推荐答案
出现了同样的问题.通过控制台应用程序在服务器上以管理员身份提升权限运行不起作用.但是,如果通过具有提升权限的PowerShell或Visual Studio本身运行,它确实可以工作.调试器需要Admin privs才能实时连接.作为控制台运行时,添加清单等似乎没有帮助.
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.
这篇关于ClrMD关于另一个用户的进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!