The nuget configuration transformations actually work with the ANY XML file using the same * .tformform convention (with the exception of package.config, for which there are other hacks / workarounds).
If you just need to convert (read: add / merge changes to) the csdef file, this should work.
If not, you can try the PowerShell route and modify the target file using the XML template file built into your package. If you need inspiration on how to do this, you can find an example package that generates a specific XML file (actually a nuspec file) here: https://github.com/myget/NuGetPackages/blob/master/NuSpec/tools /init.ps1
Also, if the question still stands, could you please indicate which version of nuget you are using?
Xavier decoster
source share