qetza / vsts-xdttransform-task

Visual Studio Team Services Build and Release extension that applies XDT transforms on XML files.
MIT License
20 stars 9 forks source link

update Microsoft.Web.XmlTransform.dll to v3.1.0 #26

Closed livioc closed 3 years ago

livioc commented 3 years ago

Hi, with the version of Microsoft.Web.XmlTransform.dll used by the task I have some problems because it doesn't support the replace of a root element having attributes that instead is supported by the latest version, used by visual studio too (https://www.nuget.org/packages/Microsoft.Web.Xdt/). I downloaded and tried the latest version (v3.1.0) for .net 4 using the API required by your task and I haven't found any breaking changes (I used c# because I'm not very good with ps :) ) var source = new Microsoft.Web.XmlTransform.XmlTransformableDocument { PreserveWhitespace = true }; source.Load(sourceFile); var transform = File.ReadAllText(transformFile); var transformation = new Microsoft.Web.XmlTransform.XmlTransformation(transform, false, null); transformation.Apply(source); source.Save(outputFile);

I don't know gulp but, if it's possible, maybe a better way is to download the dll from the nuget package within the gulp build script so the dll isn't included in this git rep