App_Config folder config files not being transformed

I have an App_config folder with a number of config files, a standard project layout in addition to the Web.config.
I have corresponding transform files for them in my solution and these are correctly contained in the .nupkg file.

I have named the environment the same as the transform file.

It is not transforming the config files in the App_Config folder. (WebAPI project)
E.g. .\App_Config\connectionstrings.config’ (with corresponding ‘connectionstrings.EUCorpDev.config’)

I have set the ‘Configuration Transforms’ on but no idea what to put in ‘Additional transforms’ can only find basic documentation on this field.

Version: 2.4.9.167-x64

Any thoughts would be appreciated.

I have added additional doc of screenshots.

Screenshots.docx (48 KB)

Hi Chris,

Thanks for getting in touch!

What you have shown here should work, you should not need to add additional transforms.
So to try to troubleshoot this, can you check that the connectionstrings.config files are not being put into a secondary folder, and also provide us with a screenshot of your NuGet package in a package explorer just so we can see where these files are and why they aren’t working.

Vanessa

Hi Vanessa,

Thanks for the reply.

The packager looks as though it has put the transforms in .\bin\app_config…
I have marked them ‘Copy If Newer’ in the solution. I am using Octopack, is there additional configuration I need?

Screen shot of Nuget Packager attached.

Many thanks
Chris

Doc2.docx (27 KB)

Hi,

I had not set the properties of the transform files to ‘Content’.
Having done this they are in the correct location in the NMNuget Package and are being transformed correctly.

Many thanks.

The “Content” thing is what caused my transformations not to work. They defaulted to Build Action : None but switching it to “Content” makes them work!