问题
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