다음을 통해 공유


ApplicationDomain.WorkerProcess 속성

정의

애플리케이션 도메인이 상주하는 작업자 프로세스를 가져옵니다.

public:
 property Microsoft::Web::Administration::WorkerProcess ^ WorkerProcess { Microsoft::Web::Administration::WorkerProcess ^ get(); };
public Microsoft.Web.Administration.WorkerProcess WorkerProcess { get; }
member this.WorkerProcess : Microsoft.Web.Administration.WorkerProcess
Public ReadOnly Property WorkerProcess As WorkerProcess

속성 값

WorkerProcess 애플리케이션 도메인이 만들어진 개체입니다.

예제

다음 예제에서는 모든 속성을 보고 애플리케이션 도메인을 언로드하는 방법을 보여 줍니다.

using System;
using Microsoft.Web.Administration;

namespace AdministrationSnippets
{
    public class MicrosoftWebAdministrationApplicationDomain
    {
        ServerManager manager = new ServerManager();

        public void RecycleApplicationDomains()
        {
            Console.WriteLine("Displaying Worker Processes & Application Domains...");
            GetApplicationDomains();
            
            Console.WriteLine("Unloading all application domains");
            UnloadApplicationDomains();

            Console.WriteLine("Displaying Worker Processes & Application Domains with new IDs...");
            GetApplicationDomains();
        }
        public void UnloadApplicationDomains()
        {
            foreach (WorkerProcess proc in manager.WorkerProcesses)
            {
                foreach (ApplicationDomain ad in proc.ApplicationDomains)
                {
                    ad.Unload();
                }
            }
        }
        public void GetApplicationDomains()
        {
            foreach (WorkerProcess proc in manager.WorkerProcesses)
            {
                Console.WriteLine("Worker Process Found:");
                Console.WriteLine("\tProcessId:   {0}", proc.ProcessId);
                Console.WriteLine("\tProcessGuid: {0}", proc.ProcessGuid);
                Console.WriteLine("\tAppPoolName: {0}", proc.AppPoolName);
                Console.WriteLine("\tApplication Domains:");
                foreach (ApplicationDomain ad in proc.ApplicationDomains)
                {
                    Console.WriteLine("\t\tApplication Domain Found:");
                    Console.WriteLine("\t\t{0}", ad.Id );
                    Console.WriteLine("\t\t{0}", ad.VirtualPath );
                    Console.WriteLine("\t\t{0}", ad.PhysicalPath );
                    Console.WriteLine("\t\t{0}", ad.Idle);
                }
            }
        }
    }
}

설명

서버의 모든 작업자 프로세스를 보려면 속성을 사용합니다 Microsoft.Web.Administration.ServerManager.WorkerProcesses .

적용 대상