2

I've created a nuget package that needs to add some configuration to an existing xml file on installation.

The xml file is located deep in the folder structure like: /app/config/site1/settings.xml

Is it possible to use XDT to transform this file and add some configuration?

Kulvis
  • 655
  • 11
  • 33

1 Answers1

3

yes, NuGet XDT transformation feature does support the use of solution folders and can also transform general XMLs.

Just place the settings.xml.install.xdt and settings.xml.uninstall.xdt files in the same folder structure (as your target folder structure), under the Content folder of your package.

Dan Liu
  • 812
  • 5
  • 1
  • Hi Dan. Is it also possible to use this type of transform mechanism to add lines to an htm/html HTML5 document (which is basically marked up xml anyway? I have tried to do it, but I haven't been successful so far. – Yann Duran May 27 '14 at 06:50
  • hi, Yann. Currently NuGet on supports .config files and .xml files for XDT transformation. However, for your case, the use of .pp source code transformation may work. For more information, refer to this link - http://docs.nuget.org/docs/creating-packages/configuration-file-and-source-code-transformations – Dan Liu Jun 03 '14 at 23:51
  • thanks for that link. I already use source code transformations for c# files. I don't understand how it would be able to be applied to an HTML file though. – Yann Duran Jun 03 '14 at 23:56