2

I have a Web application (with a Web.config file), which will move through the normal "Development", "Testing", "Staging", and "Production" environments. I'm trying to figure out how to create environment specific Web.config files in my Visual Studio project.

I am looking for a method to provide say "Web.config.testing" and "Web.config.staging", which will be used by the application either at runtime or compile time, based on say, an environment variable "ENVIRONMENT=testing", "ENVIRONMENT=staging", etc. I have looked at the "Configuration Manager" in Visual Studio, but don't understand how or if I can attach different settings to the different Configurations there.

Can anyone tell me if Visual Studio has the functionality to allow this type of environment dependent configuration?

Update: Visual Studio supports this without the use of external classes with Web.config Transformation

Drew
  • 1,687
  • 5
  • 25
  • 46
  • 1
    Yes; see http://stackoverflow.com/questions/3004210/app-config-transformation-for-projects-which-are-not-web-projects-in-visual-stud or http://stackoverflow.com/questions/4464148/can-we-have-multiple-app-config-files-in-net-console-application for example. – dash Jun 12 '12 at 23:39

1 Answers1

0

Update: Visual Studio supports this without the use of external classes with Web.config Transformation

Drew
  • 1,687
  • 5
  • 25
  • 46