We came across this error message, but it was pointing in the opposite direction to the real error:
Could not transform the file 'D:\Octopus\Applications\xx-UK-UAT\xx-UK-UAT\Spendvision.Mobile\2019.2.1364-RC\Website\api\Content\C_C\BuildAgent\work\bc6f8ca4640d0775\Mobile\obj\api\Release\Package\PackageTmp\WebConfig\Saml.Configuration.TrustedIssuers_OneWithAuthenticationType.config' using the pattern 'Release'.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Octopus\Applications\xx-UK-UAT\xx-UK-UAT\Spendvision.Mobile\2019.2.1364-RC\Website\api\Content\C_C\BuildAgent\work\bc6f8ca4640d0775\Mobile\obj\api\Release\Package\PackageTmp\WebConfig'.
The real error appeared to be due to the long filename. Note the there is no corresponding .release.config
file for the Saml.Configuration.TrustedIssuers_OneWithAuthenticationType.config
file. So Octopus should not have been attempting to transform the file in the first place.
We fixed the problem by shortening the path for the directory where the .nupkg is unpacked.
Suggestion: please supply a more informative error message in this situation?