다음을 통해 공유


애플리케이션 종속성 <애플리케이션디펜덴시>

개요

<applicationDependencies>보안> 요소의< 요소는 isapiCgiRestriction> 요소와< 함께 작동하여 하나 이상의 CGI 또는 ISAPI 확장 제한에 종속된 애플리케이션을 정의합니다. 애플리케이션이 이 요소에 포함된 경우 애플리케이션은 isapiCgiRestriction 요소의< 항목(또는 여러 항목)에 종속됩니다>.

호환성

버전 참고
IIS 10.0 <applicationDependencies> 요소가 IIS 10.0에서 수정되지 않았습니다.
IIS 8.5 <applicationDependencies> 요소가 IIS 8.5에서 수정되지 않았습니다.
IIS 8.0 <applicationDependencies> 요소가 IIS 8.0에서 수정되지 않았습니다.
IIS 7.5 <applicationDependencies> 요소가 IIS 7.5에서 수정되지 않았습니다.
IIS 7.0 <applicationDependencies> 요소의 <security> 요소는 IIS 7.0에서 도입되었습니다.
IIS 6.0 요소는 <applicationDependencies>IIsWebService 메타베이스 개체의 IIS 6.0 ApplicationDependencies 특성을 대체합니다.

설치 프로그램

요소는 <applicationDependencies> IIS 7의 기본 설치에 포함됩니다.

방법

IIS 7에 대한 요소를 구성하기 <applicationDependencies> 위한 사용자 인터페이스가 없습니다. 요소를 프로그래밍 방식으로 구성하는 <applicationDependencies> 방법에 대한 예제는 이 문서의 코드 샘플 섹션을 참조하세요.

구성

특성

없음

자식 요소

요소 Description
application 선택적 요소입니다.

CGI 또는 ISAPI 확장 제한에 대한 종속성이 있는 애플리케이션을 지정합니다.
clear 선택적 요소입니다.

applicationDependencies 컬렉션에서 애플리케이션에 대한 모든 참조를 제거합니다.

구성 샘플

다음 구성 샘플에서는 IIS 7에 <applicationDependencies> ASP(Active Server Pages) 및 사용자 지정 애플리케이션을 설치한 후 의 기본 웹 사이트 및 관련 항목 <isapiCgiRestriction> 에 대한 요소의 애플리케이션 종속성을 보여 줍니다.

  • Active Server Pages 애플리케이션은 "ASP" ISAPI/CGI 제한 그룹에 종속됩니다.
  • 사용자 지정 애플리케이션에는 "MyCustomGroup" ISAPI/CGI 제한 그룹에 대한 종속성과 ASP ISAPI/CGI 제한 그룹에 대한 추가 종속성이 있습니다.
<system.webServer>
   <security>
      <isapiCgiRestriction notListedIsapisAllowed="false" notListedCgisAllowed="false">
         <clear />
         <add allowed="true" groupId="ASP"
            path="C:\Windows\system32\inetsrv\asp.dll" 
            description="Active Server Pages" />
         <add allowed="true" groupId="MyCustomGroup"
            path="C:\Windows\system32\inetsrv\mycustom.dll"
            description="My Custom Application" />
      </isapiCgiRestriction>
   </security>
</system.webServer>

<location path="Default Web Site">
   <system.webServer>
      <security>
         <applicationDependencies>
            <application name="My Custom Application" groupId="MyCustomGroup">
               <add groupId="ASP" />
            </application>
         </applicationDependencies>
      </security>
   </system.webServer>
</location>

샘플 코드

다음 구성 샘플에서는 기본 웹 사이트에 대한 요소의 <applicationDependencies> 애플리케이션 종속성을 보여 줍니다. 사용자 지정 애플리케이션에는 "MyCustomGroup" ISAPI/CGI 제한 그룹에 대한 종속성과 ASP ISAPI/CGI 제한 그룹에 대한 추가 종속성이 있습니다.

AppCmd.exe

appcmd.exe set config "Default Web Site" -section:system.webServer/security/applicationDependencies /+"[name='My Custom Application',groupId='MyCustomGroup']" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/security/applicationDependencies /+"[name='My Custom Application',groupId='MyCustomGroup'].[groupId='ASP']" /commit:apphost

참고

AppCmd.exe 사용하여 이러한 설정을 구성할 때 커밋 매개 변수 apphost 를 로 설정해야 합니다. 그러면 구성 설정이 ApplicationHost.config 파일의 적절한 위치 섹션에 커밋됩니다.

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();
         ConfigurationSection applicationDependenciesSection = config.GetSection("system.webServer/security/applicationDependencies", "Default Web Site");

         ConfigurationElementCollection applicationDependenciesCollection = applicationDependenciesSection.GetCollection();
         ConfigurationElement applicationElement = applicationDependenciesCollection.CreateElement("application");
         applicationElement["name"] = @"My Custom Application";
         applicationElement["groupId"] = @"MyCustomGroup";

         ConfigurationElementCollection applicationCollection = applicationElement.GetCollection();
         ConfigurationElement addElement = applicationCollection.CreateElement("add");
         addElement["groupId"] = @"ASP";
         applicationCollection.Add(addElement);
         applicationDependenciesCollection.Add(applicationElement);

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample

   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration
      Dim applicationDependenciesSection As ConfigurationSection = config.GetSection("system.webServer/security/applicationDependencies", "Default Web Site")

      Dim applicationDependenciesCollection As ConfigurationElementCollection = applicationDependenciesSection.GetCollection
      Dim applicationElement As ConfigurationElement = applicationDependenciesCollection.CreateElement("application")
      applicationElement("name") = "My Custom Application"
      applicationElement("groupId") = "MyCustomGroup"

      Dim applicationCollection As ConfigurationElementCollection = applicationElement.GetCollection
      Dim addElement As ConfigurationElement = applicationCollection.CreateElement("add")
      addElement("groupId") = "ASP"
      applicationCollection.Add(addElement)
      applicationDependenciesCollection.Add(applicationElement)

      serverManager.CommitChanges()
   End Sub

End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";
var applicationDependenciesSection = adminManager.GetAdminSection("system.webServer/security/applicationDependencies", "MACHINE/WEBROOT/APPHOST/Default Web Site");

var applicationDependenciesCollection = applicationDependenciesSection.Collection;
var applicationElement = applicationDependenciesCollection.CreateNewElement("application");
applicationElement.Properties.Item("name").Value = "My Custom Application";
applicationElement.Properties.Item("groupId").Value = "MyCustomGroup";

var applicationCollection = applicationElement.Collection;
var addElement = applicationCollection.CreateNewElement("add");
addElement.Properties.Item("groupId").Value = "ASP";
applicationCollection.AddElement(addElement);
applicationDependenciesCollection.AddElement(applicationElement);

adminManager.CommitChanges();

VBScript

Set adminManager = WScript.CreateObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"
Set applicationDependenciesSection = adminManager.GetAdminSection("system.webServer/security/applicationDependencies", "MACHINE/WEBROOT/APPHOST/Default Web Site")

Set applicationDependenciesCollection = applicationDependenciesSection.Collection
Set applicationElement = applicationDependenciesCollection.CreateNewElement("application")
applicationElement.Properties.Item("name").Value = "My Custom Application"
applicationElement.Properties.Item("groupId").Value = "MyCustomGroup"

Set applicationCollection = applicationElement.Collection
Set addElement = applicationCollection.CreateNewElement("add")
addElement.Properties.Item("groupId").Value = "ASP"
applicationCollection.AddElement(addElement)
applicationDependenciesCollection.AddElement(applicationElement)

adminManager.CommitChanges()