Although your approach seems tedious, I believe this is the best approach.
I used all my configurations in a single web.config file and just commented on the Production section.
Soon after, I had to run a “hybrid” test, where my search data came from a production server, but new data was inserted into the test database. At this point, I had to start piecewise-mechanical processing of parts of the configuration block to comment / uncomment, and this became a nightmare.
, , .NET, , web.config. .test .prod .
- , , .
, ( ) , , .