Hi Tom,
It still didnot work me.I tried both ways.
I did this for second method,
<Target Name="SetIISMetabasePath" BeforeTargets="DeployVirtualDirectory;UndeployVDirs">
When I replace the variable name with hard coded value it worked but not with variable name.
I tried couple of other things,read some old posts from others and got it working in a different way .I copied the Biztalk targets "DeployVirtualDirectory" , "DeployVDirsIIS6Plus" and "UndeployVDirs" from the BizTalkDeploymentFramework.targets file into my btdfproj file and modified it.
This is how it looks in my btdfproj file,
<Target Name="DeployVirtualDirectory">
<Target Name="DeployVDirsIIS6Plus" Condition="'$(IisMajorVersion)' != '5'">
<Target Name="UndeployVDirs" DependsOnTargets="SetWinVer;GetSoftwarePaths" Condition="'$(IncludeVirtualDirectories)' == 'true' and '$(SkipUndeploy)' == 'false' and '$(UndeployIISArtifacts)' == 'true'">
I needed to set both DeployVDirsIIS6Plus and UndeployVDirs targets in order to delete the virtual directory when I undeploy my solution.
It still didnot work me.I tried both ways.
I did this for second method,
<Target Name="SetIISMetabasePath" BeforeTargets="DeployVirtualDirectory;UndeployVDirs">
<CreateProperty Value="IIS://localhost/w3svc/${IISWebSiteID}/Root">
<Output TaskParameter="Value" PropertyName="IISMetabasePath" />
</CreateProperty>
</Target>When I replace the variable name with hard coded value it worked but not with variable name.
I tried couple of other things,read some old posts from others and got it working in a different way .I copied the Biztalk targets "DeployVirtualDirectory" , "DeployVDirsIIS6Plus" and "UndeployVDirs" from the BizTalkDeploymentFramework.targets file into my btdfproj file and modified it.
This is how it looks in my btdfproj file,
<Target Name="DeployVirtualDirectory">
<CreateVirtualDirectory MetabasePath="IIS://localhost/w3svc/$(IISWebSiteID)/Root" Name="%(VDirList.Vdir)" Path="$(MSBuildProjectDirectory)\%(VDirList.Physdir)" />
</Target><Target Name="DeployVDirsIIS6Plus" Condition="'$(IisMajorVersion)' != '5'">
<!-- Create app pool and place vdir in app pool for win2003+ -->
<AssignVirtualDirectoryToAppPool
MetabasePath="IIS://localhost/w3svc/$(IISWebSiteID)/Root" VDirName="%(VDirList.Vdir)" AppPoolName="%(VDirList.AppPool)" />
<ConfigureAppPool
MetabasePath="IIS://localhost/w3svc/$(IISWebSiteID)/Root" AppPoolName="%(VDirList.AppPool)" UserName="$(VDIR_UserName)" Password="$(VDIR_UserPass)"
Condition="'$(VDIR_UserPass)' != ''" />
<Message Text="SKIPPING APP POOL IDENTITY CONFIGURATION because the property VDIR_UserPass is empty." Condition="'$(VDIR_UserPass)' == ''" />
<!-- Set the .NET runtime version on the AppPool if AppPoolNetVersion was specified; IIS 7.0+ only -->
<Exec Command=""$(AppCmd)" set apppool /apppool.name:"%(VDirList.AppPool)" /managedRuntimeVersion:"%(VDirList.AppPoolNetVersion)" /managedPipelineMode:Integrated"
Condition="'$(IisMajorVersion)' != '6' and '$(Configuration)' == 'Server' and '%(VDirList.AppPoolNetVersion)' != ''" />
</Target><Target Name="UndeployVDirs" DependsOnTargets="SetWinVer;GetSoftwarePaths" Condition="'$(IncludeVirtualDirectories)' == 'true' and '$(SkipUndeploy)' == 'false' and '$(UndeployIISArtifacts)' == 'true'">
<!-- Delete virtual directories and relevant IIS configuration. -->
<DeleteVirtualDirectory MetabasePath="IIS://localhost/w3svc/$(IISWebSiteID)/Root" Name="%(VDirList.Vdir)" ContinueOnError="true" />
</Target>I needed to set both DeployVDirsIIS6Plus and UndeployVDirs targets in order to delete the virtual directory when I undeploy my solution.