ASP.NET's Configuration System

Have you ever wondered how ASP.NET installs its fancy 'Web.config' configuration system?  Well, here it is...

HttpConfigurationSystemBase configSystem = new HttpConfigurationSystem();
MethodInfo method = typeof(ConfigurationSettings).GetMethod("SetConfigurationSystem", BindingFlags.NonPublic);
method.Invoke(null, new object[] {configSystem});

It uses refection to call a private method.  I didn't expect to find that!

5 Comments

  • Nasty little hacks creeping under the hood my precioussss...

  • Dude, I've been looking for that code for forever. Where did you find it?



    I knew installing the config system had to be dirty based on what the ConfigurationSettings exposes, but I didn't expect anything quite like that. :)

  • Reflector wouldn't want to take the precioussss away from you... :)

  • Right, I get that you can find it with reflector, but *where*? What class / method? You tease me with knowledge!

  • Anxiety is definitely the common term, a typical encounter and
    also the common issue which has usually haunted us.
    When your experience online anxiety it can be difficult to see
    the larger visualize, since you are now reluctant to be an estimated others that you simply hope to break of any societal situation making you uncomfortable as soon as possible.
    Whatever causes the misreading, the simple fact would be
    that the unconscious mind has misinterpreted the situation and also nowadays has sent a battle or flee alert to your body.

Comments have been disabled for this content.