Unable to deploy web site on specific port

I am trying to deploy a mvc web application on server IIS which already exist so i need to deploy my packages on already created virtual directory (under default website) as shown in image 3 in attachment . Octopus server always create website on 80 port in IIS even after specified different bindings. And it give this error

Attempt 1 of 5 failed: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
Waiting for 3 seconds before retrying…
Retrying…
Web site is stopped. Attempting to start…
Attempt 2 of 5 failed: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
Waiting for 3 seconds before retrying…
Retrying…
Web site is stopped. Attempting to start…
Attempt 3 of 5 failed: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
Waiting for 3 seconds before retrying…
Retrying…
Web site is stopped. Attempting to start…
Attempt 4 of 5 failed: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
Waiting for 3 seconds before retrying…
Retrying…
Web site is stopped. Attempting to start…
start-webitem : Cannot create a file when that file already exists. (Exception
from HRESULT: 0x800700B7)
At C:\Octopus\Applications\QA\QuoteStar.TeamCity\79_27\Octopus.Features.IISWebS
ite_BeforePostDeploy.ps1:655 char:4

  •         Start-Website $webSiteName
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:slight_smile: [Start-WebItem], COMExcept
      ion
    • FullyQualifiedErrorId : InvalidOperation,Microsoft.IIs.PowerShell.Provid
      er.StartItemCommand
      Script ‘C:\Octopus\Applications\QA\QuoteStar.TeamCity\79_27\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: 1
      Running rollback conventions…
      Script ‘C:\Octopus\Applications\QA\QuoteStar.TeamCity\79_27\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: 1
      The remote script failed with exit code 1
      DeploySite on QA…

Also i am attaching the binding configuration.

edited

IIS virtula directory image uploaded

Hi,

Thank you for getting in touch. Looking at your step configuration, you have set it up to create a new WebSite instead of a Virtual Directory.

You need to (values based on your IIS screenshot):

  • Select the IIS Web Application option under IIS Deployment Type
  • Set the Parent Web Site name to Default Web Site
  • Set the Virtual Path to /QA
  • You can leave Physical Path blank to keep the current path, or have it automatically set to the same as the Virtual Path
  • Set the Application Pool name to CalcuQuote_QAPool

You should not be asked to configure any bindings as they are already set by the parent WebSite.

Please see this blog post for more information.

Hope that helps,

Robert W

Thanks, Its works