ConfigurationSettings.GetConfig() always returns null
The following always indicates that the config section is not found
Code:
if ((IDictionary)ConfigurationSettings.GetConfig("LogSettings") == null)
{
Console.WriteLine("I'm null");
return;
}
else
{
}
Here's the whole content of app.config
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="LogSettings"
type="System.Configuration.SingleTagSectionHandler"/>
</configSections>
<LogSettings EnableLog="True"
LogDirPath="Log"
LogFileBaseName="Log"
ErrorEventLogFileBaseName="Log.Error"
PrefixMessageWithDateTime="True"
ExpiryDays="15"
DeleteExpiredLogFiles="True"
WriteErrorEventToSeparateFile="True"
AppendLogFileNameWithDateTime="True"
SendEmailOnErrorEvent="True"
EmailTo="[email protected]"
EmailFrom="[email protected]"
EmailCc="[email protected]"
EmailBcc="[email protected]" />
</configuration>
So, why haven't I been able to read "LogSettings" section? Thanks for the help.