ConfigReader
ConfigReader copied to clipboard
KeyNotFoundException is thrown when .config file contains a key that is missing from the interface representing the configuration.
Steps to reproduce:
-
Follow the instructions in steps 1-3 of the instruction at https://github.com/troygoode/ConfigReader/blob/master/README.markdown
-
Go to the app.config/web.config file and add an entry that is not represented in the interface representing the configuration. For example:
< add key="MailNotificationSettings.MissingFromInterface" value="Fail" / >
Note: The prefix matching the interface name is required for this issue to reproduce.
- Run the host program
Actual behavior: KeyNotFoundException is thrown from this line: https://github.com/troygoode/ConfigReader/blob/master/src/ConfigReader/ConfigConverter.cs#L34
Expected behavior: Program runs successfully, ignoring the new entry in the .config file.