Web Api IISWebSite_BeforePostDeploy.ps1 Failure

I am trying to deploy a very simple Web Api project to test out the process, but I am receiving a failure trying to do so. The configuration is very simple. I am deploying to the Default Web Site and the DefaultAppPool. The IIS bindings are the basic defaults with the host set to the machine name as resolved from the Octopus.Machine.Name variable. The error seems to be in determining what the webRoot path is. The error message returned is:

Octopus.Features.IISWebSite_BeforePostDeploy.ps1
resolve-path : Cannot find path ‘C:\Octopus\Applications\Development\MyWebApi\1.0.0.0_2\MyWebApi’ because it does not exist.

At C:\Program Files\Octopus
Deploy\Tentacle\Scripts\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:74
char:13

  • $webRoot = (resolve-path $webRoot).ProviderPath
  •         ~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (C:\Octopus\Appl…0.0_2\MyWebA
      pi:String) [Resolve-Path], ItemNotFoundException
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.Resol
      vePathCommand

PowerShell script returned a non-zero exit code: 1
Tentacle version 2.5.8.447

Hi Greg,

Thanks for getting in touch! Could you please send through the full deployment log.


It should point us to the specific issue.
Feel free to mask any sensitive data or make this thread private.

Thanks!
Vanessa

Hi Vanessa,

Thanks for getting back! I have attached a copy of the log in question.

ServerTasks-177.log.txt (10 KB)

Hi Greg,

Thanks for providing the logs. What do you have set in your IIS Website Settings > Relative Home Directory settings?
It should be left as Package Root but I am guessing it is set to MyWebAPI based on the error message.
If this is not the case can you please provide screenshots of your package IIS settings in the project step.

Thanks!
Vanessa

Hi Vanessa,

That did the trick! Thanks for the assistance!