Release Pipeline throws the following error: Unable to apply transformation for the given package - Changes are already present in the package
Asked Answered
M

3

12

I am using the File Transform V2 task on my release pipeline for my ClickOnce application deployment.

-transform **\*.Release.config -xml **\*exe.config.deploy

I've never had issues transforming and deploying ClickOnce applications in this manner, however, for some reason, when transforming this particular application, I keep getting the following error:

Unable to apply transformation for the given package - Changes are already present in the package.

I double checked my build pipeline to make sure the transforms weren't being performed at this step, and it doesn't seem like it is. Is there a way to guarantee that transforms on an app.config do not happen from within the build pipeline, just in case?

Outside of that, I have no clue as to what the issue could be. There is no other transform step anywhere within any of my pipelines, so there shouldn't be any reason for it to be preemptively transforming, at least from what I can see.

The weird part is that even though it says that it has been transformed already, it looks to me that no transform had happened at all. All the strings and values are still the same within the app.config.

If anyone has any ideas, or needs me to provide specific logs/information, please let me know.

Morelos answered 20/4, 2020 at 13:34 Comment(5)
Can you share with us your build definition? And transformation rules?Friederike
This actually is path-related issue, just make sure the system can find the specific xx.exe.config.deploy file, the error would go away~Amiamiable
So this is a case of this issue right github.com/microsoft/azure-pipelines-tasks/issues/11322 ?Friederike
@KrzysztofMadej Hmm, they have a bit difference. That one is verify the following and this one is changes already persent. The error message Unable to apply transformation for the given package. Verify the following. is not simple path-related issue. The issue in GitHub link could be related to the trans rule(syntax in transform.config), task version or what. Instead i think the issue in github is similar to this one.Amiamiable
You're right. Thanks!Friederike
A
8

I reproduced the issue and found it only occurred when the task couldn't find the source file, see:

enter image description here

1.It seems that you're using something like -xml **\*exe.config.deploy in your trans rule, try using **\*.exe.config.deploy instead of **\*exe.config.deploy.

(Or use valid name like Name.exe.config.deploy, it works well on my side)

2.And if suggestion above can't resolve your issue, you should also check the Package or folder (folderPath in yaml) input of your File Transform task. Make sure the system can find the xx.exe.config.deploy file in correct folder.

(Normally the folder would be $(System.DefaultWorkingDirectory), but not sure if you did some changes so the file was in another directory...)

Amiamiable answered 21/4, 2020 at 8:52 Comment(3)
This was it! I, for some reason, had another file in the folder with the same match pattern as I had above - i.e., "**\exe.config.deploy". I changed the match pattern to point directly to the file itself and the transformation had no issues. This was simply an oversight on my end. Thanks for the help!Morelos
Glad to know it helps :)Amiamiable
@Amiamiable I am running into the same problem but not able to solve it. I am using a simple valid name like -transform Web.config -xml see sample shot (paste.pics/DSX18) and it seems that path is correctBreland
F
2

In my case I've set xmlTransformationRules to an empty string since I'm only transforming json files.

Fiche answered 12/7 at 14:43 Comment(0)
A
0

Transformation Rules:

-transform **\App.Release.config -xml **\Name.exe.config -result **\Name.exe.config

Target Files:

**\Name.exe.config

In the output it might say, skipped updating file, but if you check the output, the file is updated

Airlee answered 25/7, 2022 at 20:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.