Valid TaskActions are:

CheckExists (Required: Website Optional: Name

Create (Required: Website Optional: Name, Parent, RequireApplication, DirectoryType, AppPool, Properties)

Delete (Required: Website Optional: Name, Parent

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 an IIsWebVirtualDir at the ROOT of the website -->
        <MSBuild.ExtensionPack.Web.Iis6VirtualDirectory TaskAction="Create" Website="awebsite" Properties="AccessRead=True;AccessWrite=False;AccessExecute=False;AccessScript=True;AccessSource=False;AspScriptErrorSentToBrowser=False;AspScriptErrorMessage=An error occurred on the server.;AspEnableApplicationRestart=False;DefaultDoc=SubmissionProtocol.aspx;DontLog=False;EnableDefaultDoc=True;HttpExpires=D, 0;HttpErrors=;Path=c:\Demo1;ScriptMaps=.htm,C:\Windows\System32\Inetsrv\Test.dll,5,GET, HEAD, POST"/>
        <!-- Check if a virtual directory exists-->
        <MSBuild.ExtensionPack.Web.Iis6VirtualDirectory TaskAction="CheckExists" Website="awebsite" Name="AVDir" >
            <Output TaskParameter="Exists" PropertyName="CheckExists" />
        </MSBuild.ExtensionPack.Web.Iis6VirtualDirectory>
        <!-- Create another IIsWebVirtualDir -->
        <MSBuild.ExtensionPack.Web.Iis6VirtualDirectory TaskAction="Create" Website="awebsite" Name="AVDir" Properties="Path=c:\Demo2"/>
        <!-- Delete the IIsWebVirtualDir-->
        <MSBuild.ExtensionPack.Web.Iis6VirtualDirectory TaskAction="Delete" Website="awebsite" Name="AVDir"/>
    </Target>
</Project>

Inheritance Hierarchy

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

See Also