Iis7Website Class | MSBuild Extension Pack Help 4.0.12.0 |
AddApplication (Required: Name, Applications Optional: AppPool, EnabledProtocols, AnonymousAuthentication, BasicAuthentication, DigestAuthentication, WindowsAuthentication, sslFlagsForce)
AddMimeType (Required: Name, MimeTypes)
AddResponseHeaders (Required: Name, HttpResponseHeaders)
AddVirtualDirectory (Required: Name, VirtualDirectories Optional: Force)
CheckExists (Required: Name Output: Exists)
CheckVirtualDirectoryExists (Required: Name, VirtualDirectories Output: Exists)
Create (Required: Name, Path, Port Optional: Identifier, Force, Applications, VirtualDirectories, AppPool, EnabledProtocols, LogExtFileFlags, LogDirectory, LogFormat, AnonymousAuthentication, BasicAuthentication, DigestAuthentication, WindowsAuthentication, ServerAutoStart, ConnectAsUser, ConnectAsUserPassword)
Delete (Required: Name)
DeleteVirtualDirectory (Required: Name, VirtualDirectories)
GetInfo (Required: Name Output: SiteInfo, SiteId)
ModifyPath (Required: Name, Path Output: SiteId)
ModifyLogDirectory (Required: Name, LogDirectory)
SetWindowsAuthenticationProviders (Required: Name, Providers Optional: UseKernelMode)
Start (Required: Name)
Stop (Required: Name)
Remote Execution Support: Yes
MSBuild.ExtensionPackBaseTask
MSBuild.ExtensionPack.WebIis7Website
Namespace: MSBuild.ExtensionPack.Web
Assembly: MSBuild.ExtensionPack.Iis7 (in MSBuild.ExtensionPack.Iis7.dll) Version: 4.0.0.0
The Iis7Website type exposes the following members.
Name | Description | |
---|---|---|
Iis7Website |
Name | Description | |
---|---|---|
AnonymousAuthentication |
Sets AnonymousAuthentication for the website. Default is true
| |
Applications |
ITaskItem of Applications. Use AppPool, PhysicalPath and EnabledProtocols metadata to specify applicable values
| |
AppPool |
Sets the app pool.
| |
BasicAuthentication |
Sets BasicAuthentication for the website. Default is false;
| |
ConnectAsUser |
Sets the user of the application (instead of pass-throught authentication).
| |
ConnectAsUserPassword |
Sets the password of the application user (instead of pass-throught authentication).
| |
DigestAuthentication |
Sets DigestAuthentication for the website. Default is false;
| |
EnabledProtocols |
Sets the Enabled Protocols for the website
| |
Exists |
Gets whether the website exists
| |
Force |
Set to true to force the creation of a website, even if it exists.
| |
HttpResponseHeaders |
A collection of headers to add. Specify Identity as name and add Value metadata
| |
Identifier |
Gets or sets the Identifier for the website. If specified for Create and the Identifier already exists, an error is logged.
| |
LogDirectory |
Sets the directory the website writes logfiles to.
| |
LogExtFileFlags |
Sets the LogExtFileFlags. Default is 1414 (logextfiletime | logextfileclientip |logextfilemethod | logextfileuristem | logextfilehttpstatus)
| |
LogFormat |
Sets the LogExtFileFlags. Default is W3c.
| |
MimeTypes |
A collection of MimeTypes. Specify Identity as name and add Value metadata
| |
Name |
Sets the name of the Website
| |
Path |
Sets the path.
| |
PhysicalPath |
Gets the site physical path. [Output]
| |
Port |
Sets the port.
| |
Providers |
Sets the authentication providers. The authentication providers must be passed in a semicolon separated string.
| |
ServerAutoStart |
Sets ServerAutoStart for the website. Default is true.
| |
SiteId |
Gets the site id. [Output]
| |
SiteInfo |
Gets the SiteInfo Item. Identity = Name, MetaData = ApplicationPoolName, PhysicalPath, Id, State
| |
SslFlags |
Sets the SSl Flag for the website
| |
UseKernelMode |
Sets whether Windows authentication is done in kernel mode. Default is true.
| |
VirtualDirectories |
ITaskItem of VirtualDirectories. Use PhysicalPath metadata to specify applicable values
| |
WindowsAuthentication |
Sets WindowsAuthentication for the website. Default is false;
|
<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)"/> <ItemGroup> <Application Include="/photos"> <PhysicalPath>C:\photos</PhysicalPath> <AppPool>NewAppPool100</AppPool> <WindowsAuthentication>true</WindowsAuthentication> <AnonymousAuthentication>false</AnonymousAuthentication> </Application> <Application Include="/photos2"> <PhysicalPath>C:\photos2</PhysicalPath> </Application> <VirtualDirectory Include="/photosToo"> <ApplicationPath>/photos2</ApplicationPath> <PhysicalPath>C:\photos2</PhysicalPath> </VirtualDirectory> <HttpResponseHeaders Include="DemoHeader"> <Value>DemoHeaderValue</Value> </HttpResponseHeaders> <MimeTypes Include=".test"> <Value>test/test1</Value> </MimeTypes> </ItemGroup> <Target Name="Default"> <!-- Create a site with a virtual directory --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Create" Name="NewSite" Path="c:\demo" Port="86" Force="true" Applications="@(Application)" VirtualDirectories="@(VirtualDirectory)"> <Output TaskParameter="SiteId" PropertyName="NewSiteId"/> </MSBuild.ExtensionPack.Web.Iis7Website> <Message Text="NewSite SiteId: $(NewSiteId)"/> <!-- GetInfo --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="GetInfo" Name="NewSite"> <Output TaskParameter="SiteInfo" ItemName="SiteInfo"/> </MSBuild.ExtensionPack.Web.Iis7Website> <Message Text="Id: %(SiteInfo.Id)"/> <Message Text="ApplicationPoolName: %(SiteInfo.ApplicationPoolName)"/> <!-- Add HTTP Response Headers --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="AddResponseHeaders" Name="NewSite" HttpResponseHeaders="@(HttpResponseHeaders)"/> <!-- Add Mime Types --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="AddMimeType" Name="NewSite" MimeTypes="@(MimeTypes)"/> <!-- Check whether the virtual directory exists --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="CheckVirtualDirectoryExists" Name="NewSite" VirtualDirectories="@(VirtualDirectory)"> <Output TaskParameter="Exists" PropertyName="VDirExists"/> </MSBuild.ExtensionPack.Web.Iis7Website> <Message Text="VDirExists Exists: $(VDirExists)"/> <!-- Start a site --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Start" Name="NewSite2"/> <!-- Check if the site exists --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="CheckExists" Name="NewSite2"> <Output TaskParameter="Exists" PropertyName="SiteExists"/> </MSBuild.ExtensionPack.Web.Iis7Website> <Message Text="NewSite2 SiteExists: $(SiteExists)"/> <!-- Create a basic site --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Create" Name="NewSite2" Path="c:\demo2" Port="84" Force="true"> <Output TaskParameter="SiteId" PropertyName="NewSiteId2"/> </MSBuild.ExtensionPack.Web.Iis7Website> <Message Text="NewSite2 SiteId: $(NewSiteId2)"/> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="CheckExists" Name="NewSite2"> <Output TaskParameter="Exists" PropertyName="SiteExists"/> </MSBuild.ExtensionPack.Web.Iis7Website> <Message Text="NewSite2 SiteExists: $(SiteExists)"/> <!-- Stop a site --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Stop" Name="NewSite2"/> <!-- Start a site --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Start" Name="NewSite2"/> <!-- Delete a site --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Delete" Name="NewSite2"/> <!-- Set Windows Authentication Providers --> <MSBuild.ExtensionPack.Web.Iis7Website TaskAction="SetWindowsAuthenticationProviders" Name="NewSite" Providers="Negotiate" UseKernelMode="False"/> </Target> </Project>