3

Given a web application with the following structure:

Main Site (/)
    web.config (root; appSetting="rootSetting")
    Applications (/Applications)
        App1 (/Applications/App1)
            web.config (app1; appSetting="app1Setting")

Inside the application, most of the time I can obtain both the "rootSetting" and the "app1Setting" via WebConfigurationManager.AppSettings[] and WebConfigurationManager.ConnectionStrings[] static indexers.

However, from time to time, it appears that the App1's web.config does not get loaded. When this occurs, I can get "rootSetting" but "app1Setting" returns null.

I am running under Windows Server 2008 R2 / IIS7.5 / ManagedPipelineMode=Classic.

Jason
  • 4,897
  • 2
  • 33
  • 40

1 Answers1

1

Consider using a settings file, as describing in the answer to this question. It may simplify what you are trying to accomplish.

Community
  • 1
  • 1
retrodrone
  • 5,850
  • 9
  • 39
  • 65
  • Thx @retrodrone, I went with using WebConfigurationManager.OpenWebConfiguration(path) to specify exactly which web.config i wanted to open. – Jason Aug 04 '11 at 15:10