I am accessing the key from App.config in the class. If I give the key irrespective of case I am able to access its value.
I have checked that I am not doing ToLower() anywhere.
//The below is the key in App.config
<add key="Timezone_Minutes" value="+100"/>
//Accessing this key in class
private static readonly string timezoneMinutes = ConfigurationSettings.AppSettings["TIMEZONE_MINUTES"];
I am getting the value +100 in timezoneMinutes. The key given in App.config is Timezone_Minutes, but accessing in class is TIMEZONE_MINUTES. But still I get the value. Is it case insensitive. I googled, but didn't get the proper answer.
As per the docs (for the type returned by AppSettings
):
The default comparer is a CaseInsensitiveComparer that uses the conventions of the invariant culture; that is, key comparisons are case-insensitive by default.
This is consistent with the behaviour you are seeing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With