Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create custom web.config in ASP.Net MVC4?

Only having debug and release web.config files is not enough for our deployment process. We use the standard Web.config for local development, Web.Debug.config for the shared development environment, and Web.Release.config for staging and production environments.

Now we would like to have a distinct configuration for staging and production environments.
Is it possible to create a new configuration profile 'staging', have the associated web.staging.config, and tell the build process to use the transformations it defines when we select the appropriate publish profile?

like image 274
Antoine Avatar asked Oct 08 '13 08:10

Antoine


1 Answers

Ok I got it. You need to go to the solution's properties > Configuration > Configuration Manager. Open the Active solution configuration dropdown > New, to create a new configuration scheme. Leave the Create new project configurations checked.

Then right-click the web.config file and click Add Config Transform. Finally, you can edit the publish profiles to use the new configuration.

like image 99
Antoine Avatar answered Oct 16 '22 14:10

Antoine