Iis6VirtualDirectory Class

MSBuild Extension Pack

Iis6VirtualDirectory Class MSBuild Extension Pack Help 4.0.12.0
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.

Inheritance Hierarchy

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

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

The Iis6VirtualDirectory type exposes the following members.

Constructors

  NameDescription
Public methodIis6VirtualDirectory
Top
Methods

  NameDescription
Public methodDispose
Top
Properties

  NameDescription
Public propertyAppPool
Sets the AppPool to run in. Default is 'DefaultAppPool'
Public propertyDirectoryType
Sets the DirectoryType. Supports IIsWebDirectory and IIsWebVirtualDir. Default is IIsWebVirtualDir.
Public propertyExists
Gets whether the Virtual Directory exists
Public propertyName
Sets the name of the Virtual Directory. Defaults to 'ROOT'
Public propertyParent
Sets the Parent. Defaults to /ROOT
Public propertyProperties
Sets the Properties. Use a semi-colon delimiter. See Metabase Property Reference (IIS 6.0) If a property contains =, enter #~# as a special sequence which will be replaced with = during processing
Public propertyRequireApplication
Sets whether an Application is required. Defaults to true.
Public propertyWebsite
Sets the name of the Website to add the Virtual Directory to.
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">
    <!-- 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>
See Also

Reference