Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Issue: ConfigurationManager changing web.config in partial trust environments [749]

$
0
0
WebConfigurationManager (and ConfigurationManager) throw exceptions when trying to load a web.config in anything less than High Trust environments. The sole reason for this being that the local web.config is merged all the way down from the machine-level web.configs, via any parent applications in IIS.

Better idea: put all inherited configs into a read-only dictionary at runtime (rather than putting the ConfigurationManager settings into a dictionary, which is what actually happens, therefore preventing writing back of a .config file to disk after modifying a setting). When the web.config is loaded at runtime, take the inherited settings dictionaries, apply them to the local web.config settings. Then, in the setters of the strongly-typed classes, check whether the setting is local or not. If yes, write to the file and allow save, if no, check if over-rides are allowed for the setting. If yes, add the new setting and save. If no, exception out.

Viewing all articles
Browse latest Browse all 7215

Trending Articles