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
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
Name | Description | |
---|---|---|
Iis6VirtualDirectory |
Methods
Name | Description | |
---|---|---|
Dispose |
Properties
Name | Description | |
---|---|---|
AppPool |
Sets the AppPool to run in. Default is 'DefaultAppPool'
| |
DirectoryType |
Sets the DirectoryType. Supports IIsWebDirectory and IIsWebVirtualDir. Default is IIsWebVirtualDir.
| |
Exists |
Gets whether the Virtual Directory exists
| |
Name |
Sets the name of the Virtual Directory. Defaults to 'ROOT'
| |
Parent |
Sets the Parent. Defaults to /ROOT
| |
Properties |
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
| |
RequireApplication |
Sets whether an Application is required. Defaults to true.
| |
Website |
Sets the name of the Website to add the Virtual Directory to.
|
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