How does System.Configuration.ConfigurationManager know what web.config to use?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moorcroft
    New Member
    • Mar 2008
    • 57

    How does System.Configuration.ConfigurationManager know what web.config to use?

    I have a .Net web service solution set up and it has about 8 projects within the solution. One of the projects is the main host project and it contains the web.config that I wish to use for the solution configuration. I'm wondering how System.Configur ation.Configura tionManager knows how to look in this config file for settings as it currently does not seem to look in here..
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    It looks in the base directory for the web.
    So if you one app at / and another at /someother/
    Then / would look in / and /someother/ would look in /someother.
    If there isn't one, I think it looks to a parent, or a global config(in iis settings)

    Comment

    • moorcroft
      New Member
      • Mar 2008
      • 57

      #3
      Cheers, I was just confusing myself. The project that wasn't using the correct config was my unit test project and I realised I needed to replicate the original web.config in the unit test project just..

      Comment

      Working...