Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add config transform for custom config file?

Visual Studio natively supports adding custom config transforms for web.config. Is there a way to do the same thing for a custom config file? For instance, the shop I'm at has an EnvironmentConfigs directory in the root of the project and there are custom appSettings.config and connectionStrings.config files. Is there a way to do the same thing that web.config does and add appSettings.Release.config and connectionStrings.Release.config transformation files that will transform them on publish?

like image 700
Chev Avatar asked Sep 28 '12 22:09

Chev


People also ask

Why is add config transform greyed out?

You need to create a configuration in a given project before it can use that transform. Either check "Create new project configurations" to create the configuration in all projects at once, or do it individually like @paulv7260 did.

How add config file in VB NET?

If you need a configuration file for your application, open your project in VS.NET, go to the 'Solution Explorer' and right click on the project name. Choose Add > Add new item from the menu and select 'Application Configuration file' from the list of choices. This will create an app.


1 Answers

I'm not sure about config's like that, but check out the Slow Cheetah extension in VS2010. You can install it by going to the Tools > Extension Manager and search the Online Gallery. It adds the ability to use config transforms for App.Config's and possibly will work in the scenario you describe. It adds a lot of transform functionality in general (even to web.config's) so it's a great tool to use. Out of the box, VS2010 will not do that, though.

Edit: According to the description for SlowCheetah: "This package enables you to transform app.config or any other XML file based on the build configuration". So yes, it seems it will do what you need...

like image 54
Adam Plocher Avatar answered Oct 20 '22 20:10

Adam Plocher