Illegal characters in path in process of file transformations if wildcards are used


I’ve just installed the latest Octopus 3.5.9 (upgrade from ~3.4.14) and my transformations that use wildcards suddenly stopped working with

Could not transform the file 'C:\Octopus\Applications\Test\DEV\Agent.WinSvc\\Agent.nlog_octopus.config' using the pattern 'Agent.*.octopus.config'.
System.ArgumentException: Illegal characters in path.

I didn’t make any changes from previous releases that finished successfully in previous Octopus server version.

Transformation in the step:

#{Service.Type}.*.octopus.config => #{Service.Executable}.config

#{Service.Executable} = TaskManagement.Agent.WinSvc.exe

It looks like you perform path validation too early before resolving wildcards.
Also error message itself is strange because according the pattern file ‘Agent.nlog_octopus.config’ should not be transformed - it’s a transformation that should be applied.

Please advice.


P.S. step log attached.

octolog.txt (8 KB)


Thanks for reaching out!

In 3.5.4, we did some work to improve the diagnostics messages around configuration transforms, and in the process it looks like I broke it for your scenario. Sorry that we’ve let you down.

Can you set a variable Octopus.Action.Package.EnableDiagnosticsConfigTransformationLogging to True on your project and redeploy? That should give me lots more information on the issue.

In the meantime, I’ll look into it based on the information you’ve provided so far, and hopefully we can get a fix out for you ASAP.



I’ve managed to reproduce the crash, and I’ve logged an issue.

I’ve got a fix ready to go - I just need to get some more testing around it and then I’ll aim to have a new release out today.


Hi there

Just a quick note to let you know the fix is available with our 3.6.0 release which you can download from

Apologies for the inconvenience.


Hello Matt,

Works like a charm :wink:

Thanks a lot for amazing quick fix. Great job.