Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ApplicationDomains Property

IIS 7.0

Gets an ApplicationDomainCollection object that contains all the application domains that are running in the current worker process.

Namespace:  Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)
public ApplicationDomainCollection ApplicationDomains { get; }

Property Value

Type: Microsoft.Web.Administration..::..ApplicationDomainCollection
An ApplicationDomainCollection object that contains an ApplicationDomain object for each application domain that is running in the current worker process.

The following example demonstrates how to enumerate the currently running worker processes and associated properties.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;

namespace AdministrationSnippets
{
    public class MicrosoftWebAdministrationWorkerProcess
    {
        public void EnumerateWorkerProcess()
        {
            ServerManager manager = new ServerManager();
            foreach (WorkerProcess proc in manager.WorkerProcesses)
            {
                Console.WriteLine("WorkerProcess found: {0}", proc.ProcessId);
                Console.WriteLine("\t|--AppPool : {0}", proc.AppPoolName);
                Console.WriteLine("\t|--ProcGuid: {0}", proc.ProcessGuid);
                Console.WriteLine("\t|--State   : {0}", proc.State.ToString());

                foreach (ApplicationDomain appDom in proc.ApplicationDomains)
                {
                    Console.WriteLine(
                        "\t+--ApplicationDomain Found: {0}", appDom.Id);
                    Console.WriteLine(
                        "\t\t|--AppDomPhysPath: {0}", appDom.PhysicalPath);
                    Console.WriteLine(
                        "\t\t+--AppDomVirtPath: {0}", appDom.VirtualPath);
                }
            }
        }
    }
}


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.