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. “sitename.com”). 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.

Thanks!

Dalmiro

Version 3.0.10.

[cid:image005.jpg@01D0D059.03AFE430]

[cid:image006.jpg@01D0D059.03AFE430]

Version 3.0.10.

Here is the error we have been getting. In this scenario we have a site1.com (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:
[cid:image001.png@01D0D059.95005C80]
[cid:image002.png@01D0D059.95005C80]

[cid:image003.png@01D0D059.95005C80]
[cid:image004.png@01D0D059.95005C80]

image001.png

Hi Mike,

I have just tried replicating this issue locally with a Website named site1.com 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 "site1.com" 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,
Henrik

Correct that was just an example. We have tried to set the variable to the following:

Site1.com
site1.com”-shown in screenshot
site1.com
Site1.comsite1.com

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.

Thanks,
Henrik

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…

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
$serverManager = New-Object Microsoft.Web.Administration.ServerManager
$serverManager.Sites | ? { $_.Name -eq 'site1.com' } | 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,
Henrik