Setting an application path in a web transform

Hi.
My project is deployed here:
D:\wwwdeployment\test\ProjectName\4.1.33
I have various persistent files which are not part of a deployment, these are kept in the parent folder, for example:
D:\wwwdeployment\test\ProjectName\MailDrop
I would like to specify this path in a Web.Test.Config transform, ideally like so:

In order that the resulting web.config file will have

But I don’t know how to get the path I want into the transformed file.

Cheers.
Murray.

Hi Murray,

Thanks for reaching out! You should be using this feature for this: http://docs.octopusdeploy.com/display/OD/Configuration+files#Configurationfiles-VariablesInFilesReplacingvariablesoutsideappSettings,applicationSettingsandconnectionStrings . Then you’ll just set a value for #{Octopus.AppPath} and It’ll be replaced in web.test.config before the transformation of the web.config.

Hope that helps!
Dalmiro

I was using the web.test.config to do this manually like so:

but I was wondering if there was a way to get this path, so I don’t have to edit this file in souce control so when I merge the trunk into the branch. I have to change this line to:

I’m trying to determine how in the future to have more flexibility over where a package is deployed, at the moment the package has various “hard-coded” reverences to it’s environment which I’m trying to remove.

The closest I could get using the feature you suggest is this:

but if the wwwdeployment folder is different in some environment then it will fail.

oh wait, found it, this does the trick.