Publishing Processes in the Debugging API
The common language runtime (CLR) debugging API also provides information about the processes and application domains on a computer.
In a typical scenario, a developer may want to debug managed code that is running on a server within a hosted application domain. The hosting environment may be running more than one application domain within a process. The developer may want to use a graphical user interface or another way to list all the processes running on the server and pick a specific process of interest. The list should include all the application domains within processes that are running managed code. The developer can then identify a specific application domain and attach a debugger to that domain.
The CLR debugging API provides the following six interfaces to enumerate the processes and application domains on a computer:
ICorPublish gets an enumerator, ICorPublishProcessEnum, that you can use to obtain the ICorPublishProcess objects that describe the processes on a computer.
You can use the methods of the ICorPublishProcess interface to check whether the process is running managed code, to get the process ID, to get the process name, and to get the ICorPublishAppDomainEnum enumerator.
You can use ICorPublishAppDomainEnum to get the ICorPublishAppDomain objects that describe the application domains in the process.
You can use the methods of the ICorPublishAppDomain interface to get the ID and the friendly name of the application domain.
ICorPublishEnum is an abstract enumerator.