.Net Hidden Gems - Web.Debug.Config and Web.Release.Config

I am planning to post some of interesting .Net tips or hidden gems in this part of series which mostly covers only the topics / areas / features that we might have overlooked as part of our .Net development.

Today, i am going to cover the purpose of web.debug.config and web.release.config files that are present in every web development project in addition to web.config. Usually, we ignore these two files when we deploy the code.

These are called web.config transformation model and it allows you to modify your web.config file in an automated fashion during deployment of your applications to various server environments. So, you can create various config file like Web.Stage.Config, Web.UAT.Config file and modify your configuration settings accordingly.

By default, it allows you to do the following transformation.

  • Replacing a node
  • Inserting a node
  • Delete a node
  • Removing Attributes
  • Setting Attributes

You can find out more details about how and where to apply in the Microsoft Documentation.

Happy Coding!