Get AppDomain for another .NET framework process

徘徊边缘 提交于 2019-12-23 20:24:11

问题


I am trying to get the AppDomain for all the .NET Framework processes running on my machine. Any advice on how to do that?


回答1:


Im not entirely clear on what you are trying to do, but if you want to enumerate all running AppDomains by attaching Visual Studio to a process, see this link: Jack Gudenkauf "Enumerating AppDomains"

In that same vein, if you want to do this AT RUNTIME (without Visual Studio) then you will probably need to include a managed debugger in your program which will allow you to 'attach' to another process. Take a look at the managed debugger example, this demonstrates a debugger, written in C#. It will then allow you to execute an 'extension' within the target application process, such as is done in Jack Gudenkauf's article. CLR Managed Debugger (mdbg) Sample



来源:https://stackoverflow.com/questions/5907913/get-appdomain-for-another-net-framework-process

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