Iis6Website Class | MSBuild Extension Pack Help 4.0.12.0 |
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.
MSBuild.ExtensionPackBaseTask
MSBuild.ExtensionPack.WebIis6Website
Namespace: MSBuild.ExtensionPack.Web
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The Iis6Website type exposes the following members.
Name | Description | |
---|---|---|
Iis6Website |
Name | Description | |
---|---|---|
Exists |
Gets whether the website exists.
| |
Force |
Set force to true to delete an existing website when calling Create. Default is false.
| |
Identifier |
Gets or sets the Identifier for the website. If specified for Create and the Identifier already exists, an error is logged.
| |
MetabasePropertyName |
Sets the Metabase Property Name to retrieve. See Metabase Property Reference (IIS 6.0) | |
MetabasePropertyValue |
Gets the string value of the requested MetabasePropertyName
| |
Name |
Gets or sets the name.
| |
Properties |
Sets the Properties. Use a semi-colon delimiter. See Metabase Property Reference (IIS 6.0) Some properties may be split within the semi colon, e.g. to set multiple server bindings you could use Properties="ServerBindings=:80:first.host.header|:80:second.host.header" If a property contains =, enter #~# as a special sequence which will be replaced with = during processing | |
Sleep |
Set the sleep time in ms for when calling Start, Stop, Pause or Continue. Default is 250ms.
|
<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"> <!-- 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>