title: c#: Log4Net console application failed to create console color according log level and crash
body: <p>So this is my <code>Log4Net</code> <code>app.config</code>:</p>
  
  <pre><code>&lt;log4net&gt;
      &lt;appender name="ConsoleAppender" type="log4net.Appender.ColoredConsoleAppender"&gt;
        &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="[%date] [%level] [%logger/%method] → %message%newline%exception"/&gt;
        &lt;/layout&gt;
        &lt;mapping&gt;
          &lt;level value="DEBUG" /&gt;
          &lt;foreColor value="Orange, HighIntensity" /&gt;
        &lt;/mapping&gt;
        &lt;mapping&gt;
          &lt;level value="INFO" /&gt;
          &lt;foreColor value="Green, HighIntensity" /&gt;
        &lt;/mapping&gt;
        &lt;mapping&gt;
          &lt;level value="WARN" /&gt;
          &lt;foreColor value="Yellow, HighIntensity" /&gt;
        &lt;/mapping&gt;
        &lt;mapping&gt;
          &lt;level value="ERROR" /&gt;
          &lt;foreColor value="Red, HighIntensity" /&gt;
        &lt;/mapping&gt;
      &lt;/appender&gt;
      &lt;appender name="RollingFile" type="log4net.Appender.RollingFileAppender"&gt;
        &lt;file value="c:\logs\log.txt"/&gt;
        &lt;rollingStyle value="Date" /&gt;
        &lt;appendToFile value="true" /&gt;
        &lt;rollingStyle value="Size"/&gt;
        &lt;maximumFileSize value="10MB"/&gt;
        &lt;maxSizeRollBackups value="5"/&gt;
        &lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock"/&gt;
        &lt;datePattern value="yyyyMMdd" /&gt;
        &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="[%date] [%level] - %message%newline%exception"/&gt;
        &lt;/layout&gt;
      &lt;/appender&gt;
      &lt;root&gt;
        &lt;level value="DEBUG" /&gt;
        &lt;appender-ref ref="ConsoleAppender" /&gt;
        &lt;appender-ref ref="RollingFile" /&gt;
      &lt;/root&gt;
    &lt;/log4net&gt;
  </code></pre>
  
  <p>So all works fine except the fact that i cannot create any <code>Console color</code> that i want.</p>
  
  <p>for example:</p>
  
  <pre><code>  &lt;mapping&gt;
      &lt;level value="DEBUG" /&gt;
      &lt;foreColor value="Orange, HighIntensity" /&gt;
    &lt;/mapping&gt;
  </code></pre>
  
  <p>When i try to define this <code>Orange</code> (or even <code>Gray</code>) color i received this error:</p>
  
  <blockquote>
    <p>log4net:ERROR Could not create Appender [ConsoleAppender] of type
    [log4net.Appender.ColoredConsoleAppender]. Reported error follows.
    System.ArgumentException: Requested value 'Orange, HighIntensity' was
    not found.    at System.Enum.EnumResult.SetFailure(ParseFailureKind
    failure, String failureMessageID, Object failureMessageFormatArgument)
    at System.Enum.TryParseEnum(Type enumType, String value, Boolean
    ignoreCase, EnumResult&amp; parseResult)    at System.Enum.Parse(Type
    enumType, String value, Boolean ignoreCase)    at
    log4net.Util.OptionConverter.ConvertStringTo(Type target, String txt) 
    at
    log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ConvertStringTo(Type
    type, String value)    at
    log4net.Repository.Hierarchy.XmlHierarchyConfigurator.SetParameter(XmlElement
    element, Object target)    at
    log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(XmlElement
    element, Type defaultTargetType, Type typeConstraint)    at
    log4net.Repository.Hierarchy.XmlHierarchyConfigurator.SetParameter(XmlElement
    element, Object target)    at
    log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement
    appenderElement) log4net:ERROR Appender named [ConsoleAppender] not
    found.</p>
  </blockquote>
  
  <p>But if i want to define <code>Blue</code> this works fine without any <code>errors</code>.</p>