0

Is there a dynamic way of loading the web.config based on environment. like I have local, dev and prod environment, and every time i need make changes when i run in locally or commit any changes to dev/master.

I found something that <appSettings> tag in web.config supports a file attribute that will load an external config with it's own set of key/values. These will override any settings you have in your web.config or add to them.

<appSettings file=".\EnvironmentSpecificConfigurations\dev.config">

<appSettings file=".\EnvironmentSpecificConfigurations\qa.config">

<appSettings file=".\EnvironmentSpecificConfigurations\production.config">

but I am not sure how it works, how do I implement this in my project. please help.

Sandy
  • 187
  • 2
  • 15
  • I think the subject has already been dealt with here : [http://stackoverflow.com/questions/305447/using-different-web-config-in-development-and-production-environment](http://stackoverflow.com/questions/305447/using-different-web-config-in-development-and-production-environment) – Jean-Philippe Vankemmel Jan 18 '17 at 19:44

1 Answers1

0

Aahhh, I have done this with below approach. here is the link

https://weblogs.asp.net/scottgu/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005

Sandy
  • 187
  • 2
  • 15