You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.
To add a mapping to a managed handler, use the following syntax:
appcmd set config /section:handlers /+[name='
string
',path='
string
',verb='
string
',type='
string
',preCondition='
string
']
The variable name string is the name of the managed handler, and path string is the file name extension or file name that the handler processes. The variable verb string is the HTTP verb or list of HTTP verbs to which to restrict the handler, such as GET, HEAD, POST, DEBUG. If you specify more than one verb for verb string, separate each verb in the list by using a comma but no spaces. The variable type string is the managed type for the handler, such as System.Web.Handlers. The variable preCondition string is rule or list of rules under which the handler will respond, such as for requests made to application pools that are configured to use Integrated mode or for 32-bit requests. For more information about preconditions, see the handlers section in the IIS 7.0: IIS Settings Schema on MSDN.
For example, to add a managed handler mapping for a managed handler named ImageCopyrightHandler-Integrated that responds to GET and HEAD requests for .jpg files and processes those requests by using the IIS 7 integrated pipeline, type the following at the command prompt, and then press ENTER:
appcmd set config /section:handlers /+[name='
ImageCopyrightHandler-Integrated
',path='*.jpg',verb='GET,HEAD',type='System.Web.Handlers',preCondition='integratedMode']
For more information about Appcmd.exe, see Appcmd.exe.
Use the following WMI classes, methods, or properties to perform this procedure:
-
ModulesSection class (IIS)
-
HttpModulesSection class (ASP.NET)
For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.