Search code examples
c#asp.net-mvchttpcontextconfigurationmanager

Reference to configuration manager via httpcontext


How can i get reference to the configuration manager via httpcontext?

Thanks


Solution

  • As pointed out by Adam, use:

    System.Configuration.ConfigurationManager
    

    It doesn't matter if it is in a class in a separate project. When you call the code from your web project, the ConfigurationManager will logic will be applied to your web app, not the containing project.