Next & Previous

Add Config Transform in Visual Studio

This is a basic thing but I forget how to do it from time to time.

You may want to add a Config transform (i.e. Web.Something.Config) to a project in one of these situations:

The upshot is pretty much the same:

Step 1. Go into Configuration Manager

'How to open configuration manager'

Open configuration manager by dropping down the config list (in the Standard toolbar) and selecting ‘Configuration Manager…’ (or, find the same option by right clicking your Solution in Solution Explorer)

If (A) this configuration already exists at Solution level then for each project, drop it down, hit ‘New…’, type the name, copy from nowhere, don’t tick ‘Create new solution configurations’. Go to Step 2.

If (B) this configuration is brand new and doesn’t exist for any project yet then use the top dropdown (‘Active solution configuration’) and pick ‘New…’, name it, copy from another config at your own disgression, and tick ‘Create new project configurations’, otherwise you’ll have to do them one-by-one as above! Congrats, you’re done.

Step 2. Add Config Transform on each project

'Add config transform'

If you need to backfill config transforms for new projects:

This option only appears if there is no config transform, for that config, in this project.

Job done, make web.