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,046
  • 5
  • 38
  • 66

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
  • 3,809
  • 2
  • 35
  • 43