prashant
prashant

Reputation: 2167

Adding Nuget Package Transformations from project file

I am trying to add Nuget Package transformations which I want to create from project file.

I tried few things like creating a content folder and adding it to my project as explained in https://docs.nuget.org/create/transforming-configuration-files-using-dottransform-files but was not able to add keys to project config files after package installation.

Workaround it to create a folder structure as explained in the above url. So I created a folders like content for transform files, lib for dlls/assemblies and it is working. But I think that this is more manual process.

Is there a way to create nuget package transformations using project file?

Upvotes: 1

Views: 165

Answers (1)

Aleksander Bethke
Aleksander Bethke

Reputation: 1479

Just add to your root files for transformations like:

  1. web.config.transform
  2. web.Release.config.transform
  3. web.Debug.config.transform

On update NuGet (from 2.6 version) will automatically transform your config files. You can even add XSD schema transformations.

Do not forget to mark *.transform files as Content and Do not copy in file properties.

Upvotes: 1

Related Questions