Unable to delete Many Virtual Directories Iis7Website, TaskAction RemoveVirtualDirectories

Nov 1, 2011 at 8:19 PM

Using the code sample

<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <PropertyGroup>
		<ExtensionTasksPath Condition="'$(ExtensionTasksPath)' == ''">g:\tasks\</ExtensionTasksPath>
    </PropertyGroup>
	
	<Import Project="$(ExtensionTasksPath)MSBuild.ExtensionPack.tasks"/>

	<ItemGroup>
		<VirtualDirectory Include="/one">
			<PhysicalPath>G:\vdirs\one</PhysicalPath>
			<ApplicationPath>/</ApplicationPath>
		</VirtualDirectory>
		<VirtualDirectory Include="/two">
			<PhysicalPath>G:\vdirs\two</PhysicalPath>
			<ApplicationPath>/</ApplicationPath>
		</VirtualDirectory>
		<VirtualDirectory Include="/three">
			<PhysicalPath>G:\vdirs\three</PhysicalPath>
			<ApplicationPath>/</ApplicationPath>
		</VirtualDirectory>
		<VirtualDirectory Include="/four">
			<PhysicalPath>G:\vdirs\four</PhysicalPath>
			<ApplicationPath>/</ApplicationPath>
		</VirtualDirectory>
	</ItemGroup>

	<Target Name="VDirs:Create">   
		<MSBuild.ExtensionPack.Web.Iis7Website 
			TaskAction="AddVirtualDirectory" 
			Name="test" 
			VirtualDirectories="@(VirtualDirectory)"
			ContinueOnError="false"
			MachineName="JET"/>
	</Target> 

	<Target Name="VDirs:Delete">
		<MSBuild.ExtensionPack.Web.Iis7Website 
			TaskAction="DeleteVirtualDirectory" 
			Name="test" 
			VirtualDirectories="@(VirtualDirectory)"
			ContinueOnError="false"
			MachineName="JET"/>
	</Target>

</Project>
I am unable to delete all the virtual directories created by the create task, it only does one at a time and the delete target must be run a number of times, is this a bug or by design ?
Coordinator
Nov 1, 2011 at 8:46 PM

It's a bug. let me see if I can fix it quickly....

Coordinator
Nov 1, 2011 at 9:01 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Nov 1, 2011 at 9:05 PM

resolved here: http://msbuildextensionpack.codeplex.com/SourceControl/changeset/changes/70959

will ship in the nov release in a few days time...

 

thanks for the feedback.

 

Mike

Nov 1, 2011 at 10:31 PM

Fantastic mike, from my point of view this is a really important fix, thanks for the clarification.