Valid TaskActions are:

Create (Required: Name Optional: Force, Properties, Identifier OutPut: Identifier)

CheckExists (Required: Name Output: Exists)

Continue (Required: Name)

Delete (Required: Name)

GetMetabasePropertyValue (Required: Name, MetabasePropertyNameOutput: MetabasePropertyValue)

Start (Required: Name)

Stop (Required: Name)

Pause (Required: Name)

Remote Execution Support: Yes. Please note that the machine you execute from must have IIS installed.

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

Examples

Xml Copy imageCopy
<Project ToolsVersion="3.5" 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">
        <!-- Create a website -->
        <MSBuild.ExtensionPack.Web.Iis6Website TaskAction="Create"  Name="awebsite" Force="true" Properties="AspEnableApplicationRestart=False;AspScriptTimeout=1200;ContentIndexed=False;LogExtFileFlags=917455;ScriptMaps=;ServerBindings=:80:www.free2todev.com;SecureBindings=;ServerAutoStart=True;UseHostName=True"/>
        <!-- Pause a website -->
        <MSBuild.ExtensionPack.Web.Iis6Website TaskAction="Pause" Name="awebsite" />
        <!-- Stop a website -->
        <MSBuild.ExtensionPack.Web.Iis6Website TaskAction="Stop" Name="awebsite" />
        <!-- GetMetabasePropertyValue -->
        <MSBuild.ExtensionPack.Web.Iis6Website TaskAction="GetMetabasePropertyValue" Name="awebsite" MetabasePropertyName="ServerState">
            <Output PropertyName="WebsiteState" TaskParameter="MetabasePropertyValue"/>
        </MSBuild.ExtensionPack.Web.Iis6Website>
        <Message Text="WebsiteState: $(ServerState)"/>
        <!-- Start a website -->
        <MSBuild.ExtensionPack.Web.Iis6Website TaskAction="Start" Name="awebsite" />
        <!-- Check whether a website exists -->
        <MSBuild.ExtensionPack.Web.Iis6Website TaskAction="CheckExists" Name="awebsite">
            <Output PropertyName="SiteExists" TaskParameter="Exists"/>
        </MSBuild.ExtensionPack.Web.Iis6Website>
        <Message Text="Website Exists: $(SiteExists)"/>
        <!-- Check whether a website exists -->
        <MSBuild.ExtensionPack.Web.Iis6Website TaskAction="CheckExists" Name="anonwebsite">
            <Output PropertyName="SiteExists" TaskParameter="Exists"/>
        </MSBuild.ExtensionPack.Web.Iis6Website>
        <Message Text="Website Exists: $(SiteExists)"/>
    </Target>
</Project>

Inheritance Hierarchy

System..::..Object
  Microsoft.Build.Utilities..::..Task
    MSBuild.ExtensionPack..::..BaseTask
      MSBuild.ExtensionPack.Web..::..Iis6Website

See Also