How To Customize Web.Config in a C# Project using Visual Studio 2010

VS2010 can transform your web.config file before each compilation and before launching any 'Run/Debug'.

web.config has children
Picture 01
Step 1: On your project, locate the visual clue that the web.config file actually ... has children.  Pay attention to the Solution Explorer window (pic. 01).  Notice that the file has a little arrow head to its left, suggesting it can be expanded.









_______________________________________________________________________

Step 2: Expand it now please.  You should see one child per each "Solution Configuration".  Usually, the default is "Debug" and "Release".  You should be seeing something like picture #02.








nAnt exercise #1  (work in progress)

The Problem

If these premises can define your problem, then nAnt can help solve it.

Premise #1: Your C# project has to be deployed onto different environments, for example:
  • Local
  • Dev
  • Test
  • Integration
  • QA
  • Training
  • Staging
  • Production
Premise #2: Certain files contain information that differ from environment to environment.

Premise #3: The web.config or app.config is not enough to contain all the variables.
This premise is actually important, because if all your variables are containedin the web.config file, then yo udo not need any tool external to Visual Studio.  VStudio 2010 has the power of pre-processing your web.config file.  You can see how to exploit that featuer on this post.
Los argumentos de Carlos Sánchez despertaron el interés del público que participó en numerosas ocasiones. “La sociedad es la discapacitante”, señaló una joven y Sánchez ahondó sobre la educación: “si la escuela les da la oportunidad, los sordos pueden hacer todo; es inconcebible decir que tienen que hablar español para estar capacitados para entender”.

Followers (Guests)