Iis7Binding Class

MSBuild Extension Pack

Iis7Binding Class MSBuild Extension Pack Help 4.0.12.0
Valid TaskActions are:

Add (Required: Name, BindingInformation or (CertificateHash and CertificateStoreName) Optional: BindingProtocol)

CheckExists (Required: Name, BindingInformation Optional: BindingProtocol Output: Exists, BindingProtocol

Modify (Required: Name, BindingInformation, PreviousBindingProtocol, PreviousBindingInformation)

Remove (Required: Name Optional: BindingProtocol)

Remote Execution Support: Yes

Inheritance Hierarchy

SystemObject  Microsoft.Build.UtilitiesTask
    MSBuild.ExtensionPackBaseTask
      MSBuild.ExtensionPack.WebIis7Binding

Namespace: MSBuild.ExtensionPack.Web
Assembly: MSBuild.ExtensionPack.Iis7 (in MSBuild.ExtensionPack.Iis7.dll) Version: 4.0.0.0

The Iis7Binding type exposes the following members.

Constructors

  NameDescription
Public methodIis7Binding
Top
Properties

  NameDescription
Public propertyBindingInformation
String containing binding information.

Format: ip address:port:hostheader

Example: *:80:sample.example.com or : *:443:

Public propertyBindingProtocol
Binding protocol. Example: "http", "https", "ftp". Default is http.
Public propertyCertificateHash
If HTTPS is used, this is the certificate hash. This is the value of "thumbprint" value of the certificate you want to use.

Format: hash encoded string. Hex symbols can be space or dash separated.

Example: 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a

Public propertyCertificateStoreName
The name of the certificate store. Default is "MY" for the personal store
Public propertyExists
Gets whether the binding exists
Public propertyName
Sets the name of the Website
Public propertyPort
Sets the port of the Binding to Modify
Public propertyPreviousBindingInformation
Sets the PreviousBindingInformation to use when calling Modify
Public propertyPreviousBindingProtocol
Sets the PreviousBindingProtocol to use when calling Modify
Top
Examples

<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <Target Name="Default">
        <!-- Add a binding -->
        <MSBuild.ExtensionPack.Web.Iis7Binding TaskAction="Add" Name="NewSite" BindingInformation="123.123.11.33:234:www.freet2odev.com" BindingProtocol="http"/>
        <!-- Check whether a binding exists-->
        <MSBuild.ExtensionPack.Web.Iis7Binding TaskAction="CheckExists" Name="NewSite" BindingInformation="123.123.11.33:234:www.freet2odev.com" BindingProtocol="http">
            <Output TaskParameter="Exists" PropertyName="DoesExist"/>
        </MSBuild.ExtensionPack.Web.Iis7Binding>
        <Message Text="Exists: $(DoesExist)"/>
        <!-- Add another binding -->
        <MSBuild.ExtensionPack.Web.Iis7Binding TaskAction="Add" Name="NewSite" BindingInformation="123.123.33.33:455:www.freet2odev.com" BindingProtocol="http"/>
        <!-- Modify the binding -->
        <MSBuild.ExtensionPack.Web.Iis7Binding TaskAction="Modify" Name="NewSite" PreviousBindingProtocol="http" PreviousBindingInformation="123.123.11.33:234:www.freet2odev.com" BindingInformation="5.5.55.5:111:www.newmod.com" BindingProtocol="http"/>
        <!-- Remove the binding -->
        <MSBuild.ExtensionPack.Web.Iis7Binding TaskAction="Remove" Name="NewSite" BindingInformation="123.123.33.33:455:www.freet2odev.com" BindingProtocol="http"/>
    </Target>
</Project>
See Also

Reference