I've read all of the examples and I've yet to figure out how to get information out of the web.config file using applicationSettings
(as opposed to appSettings
). I have the following for my configSections
:
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ExcelREST.FDAllUpAvailabilityTable.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
Then, for applicationSettings
I have:
<applicationSettings>
<ExcelREST.FDAllUpAvailabilityTable.Settings>
<setting name="RESTPageURI" serializeAs="String">
<value>http://team/_vti_bin/ExcelRest.aspx</value>
</setting>
<setting name="WorkbookLocation" serializeAs="String">
<value>/sites/tel/Shared Documents/FD Dashboard Reports.xlsx</value>
</setting>
<setting name="ResourceLoction" serializeAs="String">
<value>/model/Tables('FDAllUpAvailabilityTable')?$format=html&Ranges('MonthParameter')={0}</value>
</setting>
</ExcelREST.FDAllUpAvailabilityTable.Settings>
</applicationSettings>
Now, I suspect that I may be making an assumption that's not valid; namely, that the appropriate classes will be generated to access my configuration information by Visual Studio (2010). I've simplified the example in that I really want to have several <section name="..." >
within configSections
.
What (probably obvious) step am I missing here? (I'm coding in C# and this is an ASP.NET 4.0 MVC application.) I'm about ready to bag it and just go with the simplistic appSettings
.
Thanks!