GithubHelp home page GithubHelp logo

qetza / vsts-xdttransform-task Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 9.0 476 KB

Visual Studio Team Services Build and Release extension that applies XDT transforms on XML files.

License: MIT License

JavaScript 3.27% PowerShell 96.73%

vsts-xdttransform-task's Introduction

Donate

XDT transform task

Visual Studio Team Services Build and Release extension that applies XDT transforms on XML files.

Usage

Add a new task, select XDT Transform from the Utility category and configure it as needed.

XDT Transform parameters

Parameters include:

  • Working folder: the working directory for relative paths. If not specified the default working directory will be used.
  • Transformations: an absolute or relative comma or newline-separated transformation file rules.

Syntax: {xdt path} => {xml path}[ => {output path}]

  • web.release.config => web.config will apply web.release.config to web.config and update the file.
  • xdt\web.release.config => config\web.config => web.config will apply xdt\web.release.config to config\web.config and save the result in web.config.

Wildcard support

  • *.release.config => *.config will apply all {filename}.release.config files to {filename}.config and update the file.
  • *.release.config => config\*.config => c:\tmp\*.config will apply all {filename}.release.config files to config\{filename}.config and save the result in c:\tmp\{filename}.config.

Transform pattern must start with *
Transform file search is recursive
Relative paths for source pattern and output pattern are relative to the transform file path.

Tips

You can use the XDT transform task to inject tokens in your XML based configuration files configured for local development and then use the Replace Tokens task to replace those tokens with variable values:

  • create an XDT transformation file containing your tokens
  • setup your configuration file with local developement values
  • at deployment time
    • inject your tokens in the configuration file by using your transformation file
    • replace tokens in your updated configuration file

Debug

You can set the variable system.debug to true to enable the debug logging on the task to help you investigate unexpected behavior of the task. If you cannot fix your issue, open an issue on the github repo and i'll help you :)

Release notes

New in 3.1.0

  • Update VstsTaskSdk to 0.11.0 (#24).
  • Update Microsoft.Web.XmlTransform.dll to 3.1.0 (contributed by livioc)

New in 3.0.0

  • Add support for wildcard in transformation rules (#8) (contributed by Luuk Sommers)

New in 2.1.0

  • Add support for comma separator in Transformations parameters.

New in 2.0.0

  • Breaking change: All previous parameters are now merged in a single line using syntax {xdt path} => {xml path}[ => {output path}].
  • Add support for multiple transformations.
  • Add Working folder parameter for root of relative paths.

New in 1.0.0

  • Initial release

vsts-xdttransform-task's People

Contributors

delradie avatar livioc avatar luuksommers avatar qetza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vsts-xdttransform-task's Issues

Getting Object reference not set to an instance of an object

Hello,

I am trying to convert a config file from

<?xml version="1.0" encoding="utf-8"?>
<packagingConfig />

to

<?xml version="1.0" encoding="utf-8"?>
<packagingConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" config:version="10.1.6500.0" packagingMode="Target" />

so I created below xdt file

<?xml version="1.0" encoding="utf-8"?>
<packagingConfig
    xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"
    xmlns:config="urn:telerik:sitefinity:configuration" 
    xmlns:type="urn:telerik:sitefinity:configuration:type" 
    config:version="10.1.6500.0" 
    packagingMode="Target"
    xdt:Transform="Replace"/>

When doing a build in vsts, it throws below error:

2017-10-18T22:06:07.3442982Z ##[error]Exception calling "Save" with "1" argument(s): "Object reference not set to an instance of an object."
image

Is there something wrong with my xdt file?

Please help on this.

Thanks,
Tonny

Issue with env block size limit

Can you please update VstsTaskSdk to at least version 0.8.2 as I am faced with env block size limit issue that has been fixed here by vsts team?

REQUEST: Option to not throw an error if the file is not found

I'm trying to create a reusable task group in ADO. Some build pipelines may have a certain XDT transform while others do not.

Instead of me having to create two new tasks (a PowerShell script that determines if a file exists and sets a variable, and another XDT transform that will only run on the condition of said variable), I'd rather just have one task that won't throw an error (perhaps a warning) if the file does not exist.

web.release.config is not found

I do not think it is an issue as much as a question. i think i am doing something wrong in the build pipeline. I do not think i am generating different versions of web.config. I am hoping you can point me in the right direction to modify my build pipeline. I am using Azure DevOps for pipelines

Wildcard support for path

It is not possible to use a wildcard. like

*.Release.config => *.config
*.$(Release.EnvironmentName).config => *.config

XML encode variable values

I had a client secret that contained an invalid xml character. The error message I recieved was the following.

##[error]Exception calling "Load" with "1" argument(s): "An error occurred while parsing EntityName. Line 61, position 47."

This was due to the "&" character being in the client secret value. The thought is maybe the values should be XML encoded to prevent this error in the future.

Issue when using XDT Transformation for multiple tags inside one element

Hello,
I have my web.config file that has only the basic tags:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
		<system.webServer>
		
		</system.webServer>
</configuration>

and my xdt file that should insert some tags there

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
		<system.webServer>
			<cors enabled="true" failUnlistedOrigins="true" xdt:Transform="Insert">
				<add origin="xxxxxxx"
									 allowCredentials="true">
					<allowHeaders allowAllRequestedHeaders="true">
						<add header="authorization" />
					</allowHeaders>
					<allowMethods>
						<add method="DELETE" />
						<add method="GET" />
						<add method="POST" />
						<add method="PUT" />
						<add method="OPTIONS" />
					</allowMethods>
				</add>
			</cors>
		</system.webServer>
</configuration>

However, when the task runs, I get the following error:
"##[error]Exception calling "Apply" with "1" argument(s): "No element in the source document matches '/configuration/system.webServer/cors'""

The xdt file is supposed to insert multiple elements inside the tag (, ...)

When I tested with some online tools, I get no errors, but when running the task in Azure, I get that exception.

Am I missing something or doing something wrong?

Thank you

variable value shows as *****

using transformations: web.test.config => web.config
I have a build variable: BuildEnvironment = test
the output of the task reads as:

2017-02-27T20:51:10.3694896Z ##[section]Starting: Apply transforms web.********.config => web.config
2017-02-27T20:51:11.6174896Z Applying transformations 'D:\TFS2017Build\Agent1\_work\1\a\web.********.config' on file 'D:\TFS2017Build\Agent1\_work\1\a\web.config'...
2017-02-27T20:51:11.7110896Z ##[section]Finishing: Apply transforms web.********.config => web.config

Is this part of the TFS Logging, or is the task doing this replacement?
pic1

pic2

Multiple config transforms in one step unable to save tfs 2017

Hello,

I am trying to perform all of the configs in a single step in TFS2017, ex below:
Web.Dev.config => web.config => Web.Dev.config
Web.Tst.config => web.config => Web.Tst.config

When you go to save it Is giving an error for illegal characters and not allowing a save when I opened the network call it looks like it is sending the content as having a return carriage in it
image

Trying to perform all of the transforms on one line will allow a save but doesn't transform either file

Error trying to use wildcard

Perhaps I have it configured wrong, but I get an error when I try to use a wildcard.

Configured as such in the Transformations box:

ServiceConfiguration.Transform.xml => ServiceConfiguration.Cloud.cscfg
Wad.PublicConfig.Transform.xml => Extensions/*.PubConfig.xml
2023-01-16T20:24:25.0900710Z ##[section]Starting: Apply XDT transforms
2023-01-16T20:24:25.1058680Z ==============================================================================
2023-01-16T20:24:25.1058977Z Task         : XDT Transform
2023-01-16T20:24:25.1059123Z Description  : Apply XDT transforms on XML files
2023-01-16T20:24:25.1059300Z Version      : 3.1.0
2023-01-16T20:24:25.1059430Z Author       : Guillaume Rouchon
2023-01-16T20:24:25.1059607Z Help         : v3.1.0 - [More Information](https://github.com/qetza/vsts-xdttransform-task#readme)
2023-01-16T20:24:25.1059869Z ==============================================================================
2023-01-16T20:24:26.0778747Z Applying transformations 'D:\a\r1\a\GRM\GRM\CloudDev\Web\ServiceConfiguration.Transform.xml' on 'D:\a\r1\a\GRM\GRM\CloudDev\Web\ServiceConfiguration.Cloud.cscfg' to 'D:\a\r1\a\GRM\GRM\CloudDev\Web\ServiceConfiguration.Cloud.cscfg'...
2023-01-16T20:24:26.2164139Z Applying transformations 'D:\a\r1\a\GRM\GRM\CloudDev\Web\Wad.PublicConfig.Transform.xml' on 'D:\a\r1\a\GRM\GRM\CloudDev\Web\Extensions\*.PubConfig.xml' to 'D:\a\r1\a\GRM\GRM\CloudDev\Web\Extensions\*.PubConfig.xml'...
2023-01-16T20:24:26.5765533Z ##[error]Exception calling "Load" with "1" argument(s): "Illegal characters in path."
2023-01-16T20:24:26.5971442Z ##[section]Finishing: Apply XDT transforms

XML Transform not change config

Hello,

I have 1 file with custom name, AppSettings.DSO.config, this config containing value like below:

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <appSettings>
    <add xdt:Transform="Replace" xdt:Locator="Match(key)" key="BaseUrl" value="https://github.com"/>
  </appSettings>
</configuration>

and my original AppSettings.config:

<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
  <add key="BaseUrl" value="www.google.com"/>
</appSettings>

and the result value after transform just same like the originial config(nothing change).

log history:

2019-05-15T04:36:50.5030154Z Applying transformations 'E:\Agents\ReleaseAgent01\_work\r3\a\OnlineOrder-Build-Manual-QA-Non-Template\OnlineOrder.API-QA\Config\AppSettings.DSO.config' on 'E:\Agents\ReleaseAgent01\_work\r3\a\OnlineOrder-Build-Manual-QA-Non-Template\OnlineOrder.API-QA\Config\AppSettings.config' to 'E:\Agents\ReleaseAgent01\_work\r3\a\OnlineOrder-Build-Manual-QA-Non-Template\OnlineOrder.API-QA\Config\AppSettings.config'...
2019-05-15T04:36:50.6147773Z ##[section]Finishing: Transform Config File's for DSO

here's the screenshot of my release task using XDT Transform task:
image

is there's missing step sir? or any additional setting's maybe?

Transform on release

Hey

I have a config called web.kommuneplatformen.config that should transform to web.config.

I think i'm doing something wrong...
I only have the zipped build to work with, how would this be possible ? :)

Hope someone can help
image

Add more logs

When the task runs, I get logs like this:

2019-08-29T11:28:32.9017201Z ##[section]Starting: Apply Web.UAT.config to Web.config
2019-08-29T11:28:32.9120010Z ==============================================================================
2019-08-29T11:28:32.9120131Z Task         : XDT Transform
2019-08-29T11:28:32.9120193Z Description  : Apply XDT transforms on XML files
2019-08-29T11:28:32.9120269Z Version      : 3.0.0
2019-08-29T11:28:32.9120321Z Author       : Guillaume Rouchon
2019-08-29T11:28:32.9120407Z Help         : v3.0.0, [More Information](https://github.com/qetza/vsts-xdttransform-task#readme)
2019-08-29T11:28:32.9120507Z ==============================================================================
2019-08-29T11:28:40.5740844Z ##[section]Finishing: Apply Web.UAT.config to Web.config

It's difficult to know how many files were transformed here - did the task run successfully?

It would be good to see "Transformed X files"

How to use in TFS Release with Web deploy?

Not sure if creating an issue is the right way to ask questions, but here goes ๐Ÿ˜„

Is this plugin supposed to work in the following scenario and, if so, how?

  1. Use TFS Build to build a ASP.NET project to a web deploy package. Include web.configs for all environments in the drop.
  2. Use TFS Release to deploy the package to IIS (WinRM + WebDeploy).
  3. Transform web.config on release-time.

Unfortunate error messaging

If for some reason either your source or transform file becomes invalid (in my case I had a variable substitution task earlier that added an & to an attribute) the error message is less than revealing:

##[debug]Caught exception from task script.
##[debug]Error record:
##[debug]% : Exception calling "Load" with "1" argument(s): "An error occurred while parsing EntityName. Line 14, position 39."
##[debug]At D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\2.1.0\transform.ps1:73 char:40
##[debug]+     $transforms -split "(?:`n`r?)|," | % {
##[debug]+                                        ~~~
##[debug]    + CategoryInfo          : NotSpecified: (:) [ForEach-Object], MethodInvocationException
##[debug]    + FullyQualifiedErrorId : DotNetMethodException,Microsoft.PowerShell.Commands.ForEachObjectCommand
##[debug] 
##[debug]Script stack trace:
##[debug]at _ApplyTransform, D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\2.1.0\transform.ps1: line 32
##[debug]at <ScriptBlock>, D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\2.1.0\transform.ps1: line 112
##[debug]at <ScriptBlock>, D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\2.1.0\transform.ps1: line 73
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]at <ScriptBlock>, <No file>: line 22
##[debug]at <ScriptBlock>, <No file>: line 18
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]Exception:
##[debug]System.Management.Automation.MethodInvocationException: Exception calling "Load" with "1" argument(s): "An error occurred while parsing EntityName. Line 14, position 39." ---> System.Xml.XmlException: An error occurred while parsing EntityName. Line 14, position 39.
##[debug]   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
##[debug]   at System.Xml.XmlTextReaderImpl.ParseEntityName()
##[debug]   at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
##[debug]   at System.Xml.XmlTextReaderImpl.ParseAttributes()
##[debug]   at System.Xml.XmlTextReaderImpl.ParseElement()
##[debug]   at System.Xml.XmlTextReaderImpl.ParseElementContent()
##[debug]   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
##[debug]   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
##[debug]   at System.Xml.XmlDocument.Load(XmlReader reader)
##[debug]   at Microsoft.Web.XmlTransform.XmlFileInfoDocument.LoadFromTextReader(TextReader textReader)
##[debug]   at Microsoft.Web.XmlTransform.XmlFileInfoDocument.LoadFromFileName(String filename)
##[debug]   at Microsoft.Web.XmlTransform.XmlFileInfoDocument.Load(String filename)
##[debug]   at Load(Object , Object[] )
##[debug]   at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)
##[debug]   --- End of inner exception stack trace ---
##[debug]   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
##[debug]   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
##[debug]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[debug]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[debug]   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
##[debug]   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
##[debug]   at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
##[debug]   at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.<InvokeWithPipe>b__0()
##[debug]   at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
##[debug]   at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List`1 variablesToDefine, Dictionary`2 functionsToDefine, Object[] args)
##[debug]   at System.Management.Automation.ScriptBlock.InvokeUsingCmdlet(Cmdlet contextCmdlet, Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
##[debug]   at Microsoft.PowerShell.Commands.ForEachObjectCommand.ProcessRecord()
##[debug]   at System.Management.Automation.CommandProcessor.ProcessRecord()
##[error]Exception calling "Load" with "1" argument(s): "An error occurred while parsing EntityName. Line 14, position 39."

It would be helpful if you caught that and provided more context. For example identifying which file triggered the exception would be the minimal solution to the problem. Perhaps (in the presence of a particular variable or setting?) write out the contents of the offending file to the log because if its the result of manipulation, you're not going to know what's wrong, unless you write it out.

Using wildcards in the Transformations doesn't work in my case

I'm using this task to transform .csproj files (adding a Content Include="foo.txt" />) during the build and I wanted to use a wildcard for the project file name, but with the way wildcards work now I can't.

This works:

ProjectXtdTransformAddPipelineInfo.xml => $(ProjectFileName)

$(ProjectFileName) is set in preceding task with:

$ProjectFileName = (Get-ChildItem -Path $(build.sourcesDirectory)' -Filter *.csproj).Name

Write-Host "##vso[task.setvariable variable=ProjectFileName]$ProjectFileName"

Something like this will not work:

*AddPipelineInfo.xml => *.csproj

because that will look for a file named ProjectXtdTransform.csproj with how the code works now (which is made for handling web.release.config)

Sidenote - this is my XDT:

<?xml version="1.0"?>
<Project xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup xdt:Transform="Insert">
    <Content Include="pipeline-info.txt" />
  </ItemGroup>
</Project>

SetAttributes duplicates attributes

I have a connection string that I am trying to tokenize. My connection string is pretty standard:

<connectionStrings>
    <add name="Foo" connectionString="The connection string" providerName="System.Data.SqlClient" />
</connectionStrings>

With the transform I am attempting to simply change the connectionString attribute as follows:

<connectionStrings>
    <add name="Foo" connectionString="__FooConnectionString__" xdt:Transform="SetAttributes(connectionString)" xdt:Locator="Match(name)" />
</connectionStrings>

If I use the Preview Transform feature in Visual Studio the transform is applied properly. However, the output of the XDT Transform Task in VSTS duplicates the providerName attribute so the connection string looks like this:

<connectionStrings>
    <add name="Foo" connectionString="__FooConnectionString__" providerName="System.Data.SqlClient" providerName="System.Data.SqlClient" />
</connectionStrings>

This causes the application to fail upon startup.

XDT Transform exception ApplyTransform

Hi
We are using since weeks your plugin in our environment. But since last week, we have issues with the plugin.

2020-09-23T15:28:29.6780521Z ##[debug]Evaluating condition for step: 'Apply transforms Web.Dev.config => Web.config' 2020-09-23T15:28:29.6782710Z ##[debug]Evaluating: succeeded() 2020-09-23T15:28:29.6783207Z ##[debug]Evaluating succeeded: 2020-09-23T15:28:29.6784586Z ##[debug]=> True 2020-09-23T15:28:29.6785096Z ##[debug]Result: True 2020-09-23T15:28:29.6785662Z ##[section]Starting: Apply transforms Web.Dev.config => Web.config 2020-09-23T15:28:29.6906838Z ============================================================================== 2020-09-23T15:28:29.6907127Z Task : XDT Transform 2020-09-23T15:28:29.6907350Z Description : Apply XDT transforms on XML files 2020-09-23T15:28:29.6907570Z Version : 3.0.0 2020-09-23T15:28:29.6907748Z Author : Guillaume Rouchon 2020-09-23T15:28:29.6908950Z Help : v3.0.0, [More Information](https://github.com/qetza/vsts-xdttransform-task#readme) 2020-09-23T15:28:29.6909307Z ============================================================================== 2020-09-23T15:28:31.3677494Z ##[debug]VstsTaskSdk 0.7.1 commit f990f8d8df6197b1cfcec01031ba014ad4905681 2020-09-23T15:28:31.4848245Z ##[debug]Entering D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\3.0.0\transform.ps1. 2020-09-23T15:28:31.5171881Z ##[debug]INPUT_WORKINGFOLDER: 'D:\a\r1\a\_coca-app\drop\unzip-dev\Content\d_C\a\1\s\coca-app\obj\dev\Package\PackageTmp' 2020-09-23T15:28:31.5276961Z ##[debug]INPUT_TRANSFORMS: 'Web.Dev.config => Web.config' 2020-09-23T15:28:31.6453017Z ##[debug]Leaving D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\3.0.0\transform.ps1. 2020-09-23T15:28:31.6501509Z ##[debug]Caught exception from task script. 2020-09-23T15:28:31.6549623Z ##[debug]Error record: 2020-09-23T15:28:31.7224485Z ##[debug]_ApplyTransform : File 'D:\a\r1\a\_coca-app\drop\unzip-dev\Content\d_C\a\1\s\coca-app\obj\dev\Package\PackageTmp\Web.config' not found. 2020-09-23T15:28:31.7248222Z ##[debug]At D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\3.0.0\transform.ps1:159 char:13 2020-09-23T15:28:31.7274929Z ##[debug]+ _ApplyTransform -SourceFile $defs.SourcePattern -Transfor ... 2020-09-23T15:28:31.7295610Z ##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2020-09-23T15:28:31.7314113Z ##[debug] + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException 2020-09-23T15:28:31.7331683Z ##[debug] + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,_ApplyTransform 2020-09-23T15:28:31.7351333Z ##[debug] 2020-09-23T15:28:31.7383229Z ##[debug]Script stack trace: 2020-09-23T15:28:31.7429938Z ##[debug]at _ApplyTransform, D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\3.0.0\transform.ps1: line 15 2020-09-23T15:28:31.7449357Z ##[debug]at <ScriptBlock>, D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\3.0.0\transform.ps1: line 159 2020-09-23T15:28:31.7470955Z ##[debug]at <ScriptBlock>, D:\a\_tasks\xdttransform_98012758-c053-475d-9d6a-fd0773c39e09\3.0.0\transform.ps1: line 73 2020-09-23T15:28:31.7507139Z ##[debug]at <ScriptBlock>, <No file>: line 1 2020-09-23T15:28:31.7600465Z ##[debug]at <ScriptBlock>, <No file>: line 22 2020-09-23T15:28:31.7685786Z ##[debug]at <ScriptBlock>, <No file>: line 18 2020-09-23T15:28:31.7704346Z ##[debug]at <ScriptBlock>, <No file>: line 1 2020-09-23T15:28:31.7729210Z ##[debug]Exception: 2020-09-23T15:28:31.7780542Z ##[debug]Microsoft.PowerShell.Commands.WriteErrorException: File 'D:\a\r1\a\_coca-app\drop\unzip-dev\Content\d_C\a\1\s\coca-app\obj\dev\Package\PackageTmp\Web.config' not found. 2020-09-23T15:28:31.8031104Z ##[error]File 'D:\a\r1\a\_coca-app\drop\unzip-dev\Content\d_C\a\1\s\coca-app\obj\dev\Package\PackageTmp\Web.config' not found. 2020-09-23T15:28:31.8045418Z ##[debug]Processed: ##vso[task.logissue type=error]File 'D:\a\r1\a\_coca-app\drop\unzip-dev\Content\d_C\a\1\s\coca-app\obj\dev\Package\PackageTmp\Web.config' not found. 2020-09-23T15:28:31.8047003Z ##[debug]Processed: ##vso[task.complete result=Failed] 2020-09-23T15:28:31.8349591Z ##[section]Finishing: Apply transforms Web.Dev.config => Web.config

Do you have any idea why we are facing this issue?

Thank you

Dynamic XML Transform Support

Is it possible to dynamically define the xml transform and then apply it to the config, e.g.

 {<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <connectionStrings>
      <add name="MyDB"
           connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
           xdt:Transform="Insert" />
    </connectionStrings>
  <appSettings>
    <add xdt:Transform="Replace" xdt:Locator="Match(key)" key="webpages:Enabled" value="true" />
  </appSettings>
  <system.web>
    <compilation xdt:Transform="RemoveAttributes(debug)" />
  </system.web>
</configuration>} => app.config

-- OR --
If the xml transforms is defined in a variable, e.g., AppTrans then it could do:
AppTrans => app.config OR $(AppTrans) => app.config

Support for variable names in Transformations specification

I'd like to be able to use this as the transformation:

$(app.config.secureFilePath) => MyApplication.exe.config

But no variable substitution happens and it takes the secureFilePath as a literal string.

Maybe you could use a technique like this to expand the variables?

Linux support?

Hi, is there any plan for support linux build agents?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.