PREREQUISITES: Your system must be in Auto-storage mode of configuration.
When the system is in Auto-storage mode, you can further apply restriction to modify configuration files. This is the most common scenario of a production website delivery process.
This way, you make changes to config files only on the development environment. On the staging and the live environment, this restriction should be applied, because changes in the config files in these environments would be lost during deployment process.
The types of restriction level are:
You can do this in the following way:
You can override the restriction level when it is turned on, but you intentionally wants to change a config file. Use UnrestrictedModeRegion in the following way:
using (new UnrestrictedModeRegion())
Back To Top