tavier
tavier

Reputation: 1794

How to add transformed web.$configuration.config files to project

I have a web service project where I have one main web.config file and then different environment specific files as well like web.Staging.config/web.QE.config etc. Now, I am following this: http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx to add a prebuild event to my project to copy the configuration specific config file to the main web.config file but the problem is, it copies it without transforming and hence resulting into something like below:

<add key="somekey" value="Development" xdt:Transform="Replace" xdt:Locator="Match(key)"/>

My question is, is there a way to keep the transformed config files ready to be copied while building the project?

Upvotes: 0

Views: 294

Answers (1)

duongthaiha
duongthaiha

Reputation: 855

You can use SlowCheetah to do the transform for you.This work with multiple environment QA, UAT etc. This also has provided as nuget package

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.SlowCheetah-XMLTransforms

Recent new feature in 2017 15.8.4 has feature for managing secret. Its worth to have a look https://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Managing-User-Secrets/?utm_source=vs_developer_news&utm_medium=referral

Upvotes: 1

Related Questions