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?
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.
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.
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With