You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the ConfigSettings class to read my AppConfig but found that if any keys (or the entire config section) was missing from the AppConfig then the Load would fail with an NullReferenceException.
Interestingly, depending upon which key was missing, some of the values would be loaded but others not. I suspect it's iterating the properties in alphabetical order so it depends where it gets to before the exception is thrown.
I would like it to ignore any missing values and to load the settings that are available, leaving any missing settings with their default: zero/empty/null/etc. Perhaps a future version could allow for the specification of default values in the IsSetting attribute?
I may fork the repo and make some changes. Would you accept a pull request if I did?
The text was updated successfully, but these errors were encountered:
I'm using the ConfigSettings class to read my AppConfig but found that if any keys (or the entire config section) was missing from the AppConfig then the Load would fail with an NullReferenceException.
Interestingly, depending upon which key was missing, some of the values would be loaded but others not. I suspect it's iterating the properties in alphabetical order so it depends where it gets to before the exception is thrown.
I would like it to ignore any missing values and to load the settings that are available, leaving any missing settings with their default: zero/empty/null/etc. Perhaps a future version could allow for the specification of default values in the IsSetting attribute?
I may fork the repo and make some changes. Would you accept a pull request if I did?
The text was updated successfully, but these errors were encountered: