ConfigReader icon indicating copy to clipboard operation
ConfigReader copied to clipboard

KeyNotFoundException is thrown when .config file contains a key that is missing from the interface representing the configuration.

Open urigrumble opened this issue 11 years ago • 0 comments

Steps to reproduce:

  1. Follow the instructions in steps 1-3 of the instruction at https://github.com/troygoode/ConfigReader/blob/master/README.markdown

  2. 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.

  1. 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.

urigrumble avatar Aug 17 '14 12:08 urigrumble