Trying to configure a click once applications - app.config

I almost have the whole process working. I use Teamcity to build (unsigned) the click once, publish it locally to get the files, package these and push to OD. This then figures out the version number and Application Files folder naming, deploys the app then runs mage.exe to resign it after the publish URL is updated for each environment.

This part now works well (took a good while to get sorted). I have now added an appsetting and want to use the config transform to set it via OD Variables. Clickonce renames the files to myapp.exe.config.deploy so OD will not look in the file to transform it. My thought was I could run a powershell script during the deployment but before the transform to copy the file to remove the .deploy extension, let the transform happen then put the file back to its original name, then mage will run and resign it (hopefully).

My issue seems to be that the transform seems to happen somewhere else on the machine as I get a file not found for the end location.

Am I able to get the location that the files are put in whilst the transform happens? Also am I able to get in the middle and do this copy “trick” to get the config transforms to happen?



I found this:


which gave me the location OD puts the files before its does its transforms and then copies to custom directory.

next issue is click once doesn’t like my config anymore, think I need to do something with mage.exe to resign / hash / manifest it.