IIS6+Home Directory deployment can't find virtual directory

I have enabled “IIS6+Home Directory” selected the “Update IIS Website” and entered the site/virtual directory path.

In particular the format I am using is “sitename/VirtualDirectoryName1/VirtualDirectoryName2”

I have been very careful in copying and pasting the path values but I continue receive deployment errors “Could not find an IIS website or virtual directory named…”

Are there any known bugs involving nested Virtual Directories?

I am running on Octopus Deploy 2.4.5.46

Hi William,

Thanks for getting in touch! Could you please create screenshots of:

  • Your site and its vdirs on the server
  • The process step where you enter the site/directory path

That should help us get to the bottom of this!
Thanks.
Vanessa

Hi,

I have exactly this problem, can you please post the solution? Cheers,

Matt

Any solutions for this? I also need to create a virtual directory that is nested several levels down but do not need or want parent virtual directories to have to be created. Of course you can do this by-hand in IIS, but that is not repeatable.

Thanks.

HI Jesse,

There’s a step template in the library that creates nested VDirs without creating parent sites (it will fail if they don’t exist):

http://library.octopusdeploy.com/#!/step-template/actiontemplate-iis-virtual-directory-create

Hopefully that will serve as a starting point.

Paul

Yeah I tried that and use it for simple 1st level vdirs, but for anything nested several layers down that does not require or need parents, it does not work. I wrote a fairly simple powershell in post-deploy to handle it.

Also, I wanted to mention, and I can put this in another topic or support issue if you want, but when using the “Customer Powershell Scripts” feature for the deploy nuget package step, Octopus variable eval/expansion does not work with specific syntax. Example:

$OctopusParameters[‘html5duct.partdata.Virtual.Directory’]

vs.

$html5ductpartdataVirtualDirectory

I have to use the 2nd form, the condensed variable syntax and assign that value to a powershell variable to get the below to work. Using the first variable syntax simply leaves the unevaluated variable name in the final output.

# handles nested Virtual Directories where no parents 
# applications or virtual directories are required.

Import-Module WebAdministration

$website = $WebSiteAppPoolName
"Creating virtual directories for $website" | Write-Host

#
# scripts
#
$vdirScripts = $html5ductscriptsVirtualDirectory
$pathScripts = $html5ductscriptsInstallDirectory
"Creating virtual directory: $vdirScripts pointed to $pathScripts" | Write-Host

# create the nested html5duct virtual directory for scripts; force overwrite/recreate if exists.
New-Item "IIS:\Sites\$website\$vdirScripts" -type VirtualDirectory -physicalPath $pathScripts -force

#
# partdata
#
$vdirPartdata = $html5ductpartdataVirtualDirectory
$pathPartdata = $html5ductpartdataInstallDirectory
"Creating virtual directory: $vdirPartdata pointed to $pathPartdata" | Write-Host

# create the nested html5duct virtual directory for partdata; force overwrite/recreate if exists.
New-Item "IIS:\Sites\$website\$vdirPartdata" -type VirtualDirectory -physicalPath $pathPartdata -force