0

I am searching for a way to switch to a different app.config at runtime. These app.configs correspond to different types of environments and their urls and settings to test a web app. For example, I may have a config to navigate to the QA or STAGE environment and use certain settings as well as backend urls that correspond to those environments. So each config has its own settings. I have a base app.config that has base configs that are common to all environments in which I may test in. With that being said, I have been using Slowcheetah extension to transform to the different app.configs. However, i would like to do this pro-grammatically on a console project. How would I do that, without using Slowcheetah and perform this at runtime based on user input from the console. Here is a screen shot of my app solution explorer.

enter image description here

I have been looking at this link, and want to know if this will work. Please advise.

user5199
  • 359
  • 2
  • 15
  • The approach in that article should be viable. Here is a SO post with some alternatives that you can review: https://stackoverflow.com/questions/3004210/app-config-transformation-for-projects-which-are-not-web-projects-in-visual-stud – David Tansey Mar 21 '19 at 21:11
  • The best way to find out if the link would work FOR YOU is to try it. We are not privy to the specifics of your environment. On the surface, yes, it should work. – Darek Mar 21 '19 at 21:11
  • I want to understand what problem do you want to solve before I suggest an answer. Why do you want to change config at runtime? Do you plan to use one environment that can switch config from QA to STAGING or vise-versa at runtime? – jtabuloc Mar 22 '19 at 03:56
  • Or you just want to switch config for testing purposes without modifying your common App.config? – jtabuloc Mar 22 '19 at 04:10

0 Answers0