Deploying Build-->Change IIS Home directory with site that has a "." in the name

We have tried to use the change IIS Home Directory option in the deployment build step. However, this seems to error out since we have a period in the name of the site in IIS (i.e. “”). We do not get an error if we change the site name to not have a period. We have tried using all the escape characters we can think of but it still errors. Changing the site names is really not an option for us due to our internal setup. Any suggestions?

Hi Mike,

Thanks for reaching out. I wasn’t able to reproduce this. Would you mind telling me which version of Octopus are you using? Also, please send me a screenshot of your NuGet package deploy step. Make sure all the fields can be seen on it so I can reproduce this properly.



Version 3.0.10.



Version 3.0.10.

Here is the error we have been getting. In this scenario we have a (also what is returned with Get-website in powershell). We have tried different iterations in the site name to try to overcome including escaping characters which you see below. Here is an example:



Hi Mike,

I have just tried replicating this issue locally with a Website named on IIS, with a variable set for the Site/virtual directory value in the IIS home directory feature and I am unable to replicate the error you are encountering.

From the error message it looks like the site name is evaluated to "" which would explain why the site isn't found in IIS. Could you please show us what the value is of your#{Site}` variable?

Thank you,

Correct that was just an example. We have tried to set the variable to the following:”-shown in screenshot

All yield same results.

Hi Mike,

Can you please let me know what OS you’re running on the server you are deploying to?

I’m not sure what is going wrong here and I can’t replicate the error you’re encountering on my local server running Windows Server 2012 R2.


We are also running 2012 R2. Thanks

Hi Mike,

Sorry for the delay in getting back to you, I’ve been trying to replicate this issue locally but I am not having much luck. :frowning:

Could I get you to run the below PowerShell script (from the Script Console) on the Tentacle you are receiving this error on…

$serverManager = New-Object Microsoft.Web.Administration.ServerManager
$serverManager.Sites | ? { $_.Name -eq '' } | Select-Object Id, Name, State | Format-List

This is what we run (in C# though) to find the site when we try and update the home directory.

Thank you and kind regards,