Sunday, February 08, 2009

Tips & Tricks: Managing environment specific properties by using Configuration Manager

Many property pages of a project (File --> New --> Project --> Web Application Project) support Configuration  specific properties:

image

What this essentially means is that all the properties in that tab can be saved in the project file and will be saved per configuration.  This would mean that when your active configuration is "Debug" then all the "Debug" settings will be used.

Debug and Release configurations are available by default inVisual Studio but if you would like to add more build configurations (for various server environments like “Dev”, “QA”, “Staging”, “Production” etc then you can do so by going to the Build --> Configuration Manager.

image

You can also select your active configuration for Visual Studio 10 from the Configuration Manager UI as shown above.

The configurations are stored in the project file as shown below:

image

Note: Deleting a configuration for the solution does not delete it for every project within the solution and visa versa, so when using Configuration Manager make sure that you remove the configurations from the correct locations

Hope this helps...

2 comments:

Ian Finlay said...

really helpful and well documented - Thanks

Anonymous said...

i couldn't get post build setting to be different for different configurations