Substitute variables in .config files outside package root

Hi,

Im trying Substitute variables in .config files outside package root . So i have a custom installation directory extracting the NuGet package files to location, and need the variables in the.config files replaced.

The custom installation directory is T:\wwwroot\website\site\web.config.

How do i do this?

Many thanks

Tom

Hi Tom,

Thanks for reaching out! All you need to do is write the file path based on the package root. If you want to substitute variables in a file called web.config that’s inside of a folder called Site on the root of the package, simply put Site\Web.config on the field.

If this still doesn’t work, please share me a screenshot of your package’s directory structure (you can use https://npe.codeplex.com/).

Thanks,
Dalmiro

Hi Dalmiro, the config files are outside the package root not inside. I can see the variables being replaced in the package root folder of C:\octopus\packages but not in the custom installation directory?

Thanks

Tom

Hi Tom,

Gonna needs 2 things from you:

  1. Once the deployment is done, could you send me the full path in disk where the file you are trying to replace variables on is sitting? full path from “drive” to “file name with extension”.

  2. Please follow the below instructions and send me the deployment log:

1) Add these 2 variables to your project http://docs.octopusdeploy.com/display/OD/Debug+problems+with+Octopus+variables

2) Create a new release (so the new variables take effect) and deploy it. If possible skip as many steps as you can and only leave step we are troubleshooting in order to avoid the noise in the log.

3) Send us the raw log of that deployment http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

Thanks!
Dalmiro