(Asked by @tomhollander on Twitter) What's the most appropriate exception to throw if a required app/web.config configuration setting is not present?
views:
78answers:
2
+4
A:
System.Configuration.ConfigurationException
According to MSDN (emphasis added by me):
The ConfigurationException exception is thrown if the application attempts to read or write data to the configuration file but is unsuccessful. Some possible reasons for this can include malformed XML in the configuration file, file permission issues, and configuration properties with values that are not valid.
Jeff Fritz
2009-04-20 23:44:46