NuGet: how can I apply the conversion to the Cloud project .csdef file

I am creating a NuGet package and faced one problem: how can I apply the conversion to a file that is not web.config or app.config, I would like to convert to a ServiceDefination.csdef file, so I put a file named as ServiceDefination.csdef .transform in folder / content.

When I try to install this nuget, just make a copy of this file in the root directory called ServiceDefination.csdef.transform.txt

Can I apply the conversion to a .csdef file or is it limited to web.config and app.config?

thanks

+7
source share
1 answer

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?

+2
source

All Articles