1

I am referencing my web app's settings using a configSource attribute for the appSettings element:

<appSettings configSource="c:/settings/customer-settings.config"></appSettings>

I would now like to access this path programmatically using a Configuration object:

Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");

However the configSource path does not seem to be available?

BigONotation
  • 4,406
  • 5
  • 43
  • 72

1 Answers1

1

Try using the file attribute instead of configSource. configSource requires your config to live inside the application path, while file does not have this restriction.

some more info: ASP.NET web.config: configSource vs. file attributes

Spikolynn
  • 4,067
  • 2
  • 37
  • 44