'How to fix Encoding error that I get after enabling the XML Transformation in Azure Release pipeline
I am trying to merge different .config file to Web.config depending on which environment the Release is deployed.
But, when I enable the XML Transformation in IIS web app deploy task, I get the below mentioned encoding error.
I updated all the .config file with <?xml version="1.0" encoding="utf-8"?>
, but that did not help.
Can you please guide what's causing this and how to resolve this ?
Logs below :
2022-05-06T12:55:41.5288177Z ##[section]Starting: Gal Service Web App Deploy
2022-05-06T12:55:41.5552489Z ==============================================================================
2022-05-06T12:55:41.5552769Z Task : IIS web app deploy
2022-05-06T12:55:41.5552986Z Description : Deploy a website or web application using Web Deploy
2022-05-06T12:55:41.5553202Z Version : 0.198.0
2022-05-06T12:55:41.5553357Z Author : Microsoft Corporation
2022-05-06T12:55:41.5553630Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/iis-web-app-deployment-on-machine-group
2022-05-06T12:55:41.5553987Z ==============================================================================
2022-05-06T12:55:42.0686645Z [command]C:\azagent\A1\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.198.0\node_modules\azure-pipelines-tasks-webdeployment-common\7zip\7zip\7z.exe x -oC:\azagent\A1\_work\_temp\temp_web_package_7556076901452693 C:\azagent\A1\_work\r5\a\_Gal\dropGalservice\GalPublish.zip
2022-05-06T12:55:42.1085817Z
2022-05-06T12:55:42.1086508Z 7-Zip [64] 16.00 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-10
2022-05-06T12:55:42.1086747Z
2022-05-06T12:55:42.1087046Z Scanning the drive for archives:
2022-05-06T12:55:42.1087266Z 1 file, 24101543 bytes (23 MiB)
2022-05-06T12:55:42.1087372Z
2022-05-06T12:55:42.1087623Z Extracting archive: C:\azagent\A1\_work\r5\a\_Gal\dropGalservice\GalPublish.zip
2022-05-06T12:55:42.7166781Z --
2022-05-06T12:55:42.7167278Z Path = C:\azagent\A1\_work\r5\a\_Gal\dropGalservice\GalPublish.zip
2022-05-06T12:55:42.7168109Z Type = zip
2022-05-06T12:55:42.7168503Z Physical Size = 24101543
2022-05-06T12:55:42.7168682Z
2022-05-06T12:55:42.7185541Z Everything is Ok
2022-05-06T12:55:42.7185833Z
2022-05-06T12:55:42.7186125Z Folders: 3
2022-05-06T12:55:42.7186357Z Files: 123
2022-05-06T12:55:42.7186630Z Size: 58978206
2022-05-06T12:55:42.7186941Z Compressed: 24101543
2022-05-06T12:55:43.4658838Z [command]C:\azagent\A1\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.198.0\ctt\ctt.exe s:C:\azagent\A1\_work\_temp\temp_web_package_7556076901452693\Web.config t:C:\azagent\A1\_work\_temp\temp_web_package_7556076901452693\Web.Release.config d:C:\azagent\A1\_work\_temp\temp_web_package_7556076901452693\Web.config pw i verbose
2022-05-06T12:55:43.6253468Z System.NullReferenceException: Object reference not set to an instance of an object.
2022-05-06T12:55:43.6255179Z at Microsoft.Web.XmlTransform.XmlTransformationLogger.ConvertUriToFileName(XmlDocument xmlDocument)
2022-05-06T12:55:43.6255638Z at Microsoft.Web.XmlTransform.XmlTransformationLogger.LogWarning(XmlNode referenceNode, String message, Object[] messageArgs)
2022-05-06T12:55:43.6256021Z at Microsoft.Web.XmlTransform.Transform.ApplyOnAllTargetNodes()
2022-05-06T12:55:43.6256362Z Start tranformation to 'C:\azagent\A1\_work\_temp\temp_web_package_7556076901452693\Web.config'.
2022-05-06T12:55:43.6256757Z Source file: 'C:\azagent\A1\_work\_temp\temp_web_package_7556076901452693\Web.config'.
2022-05-06T12:55:43.6257125Z Transform file: 'C:\azagent\A1\_work\_temp\temp_web_package_7556076901452693\Web.Release.config'.
2022-05-06T12:55:43.6262845Z Transformation task is using encoding 'System.Text.UTF8Encoding'. Change encoding in source file, or use the 'encoding' parameter if you want to change encoding.
2022-05-06T12:55:43.6263668Z Executing RemoveAttributes (transform line 18, 18)
2022-05-06T12:55:43.6264240Z on /configuration/system.web/compilation
2022-05-06T12:55:43.6264912Z Applying to 'compilation' element (no source line info)
2022-05-06T12:55:43.6265636Z File: , LineNumber: 18, LinePosition: 18, Message: Argument 'debug' did not match any attributes
2022-05-06T12:55:43.6266266Z Done executing RemoveAttributes
2022-05-06T12:55:43.6386070Z ##[error]Error: XML transformation error while transforming C:\azagent\A1\_work\_temp\temp_web_package_7556076901452693\Web.config using C:\azagent\A1\_work\_temp\temp_web_package_7556076901452693\Web.Release.config.
2022-05-06T12:55:43.6471085Z ##[section]Finishing: Gal Service Web App Deploy
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|