Okay, so this one has got me a bit confused. I have the following:
string csvOfAttributes = CableSolve.Web.Properties.Settings.Default.GenerateBoothReportAttributes;
and in my web.config:
<CableSolve.Web.Properties.Settings>
<setting name="GenerateBoothReportAttributes" serializeAs="String">
<value>327, 329, 330, 369, 342</value>
</setting>
</CableSolve.Web.Properties.Settings>
I have two questions about this:
- If I omit my setting from the web.config file I receive compilation errors. How is this possible? Web.config is user-editable; I would only expect run-time errors. If I compile my application, deploy, then the user edits the name of this setting -- wouldn't that break the compiled code?
- I could potentially store this setting in the appConfig section of my web.config file. To access the values I would go through ConfigurationManager -- and I would only receive a null object at run-time if the setting is missing. This seems less advantageous as I tend to prefer my errors arising during compilation, but it leaves me wondering: what are the differences between these two options and when should I use them?