Search code examples
dotless

dotlesscss does not show errors


There's something wrong with my css because no styles are being added to my website after compilation.

How do I get dotlesscss to show errors? Regular .less shows you a nice message that's very handy.


Solution

  • You can do this very easily with web.config. In your dotless configuration section, add the following: logger="dotless.Core.Loggers.AspResponseLogger". This will make dotless output the errors instead of blank css.

    I've included the following as an example. ("..." represents existing stuff in your web.config). In my example below cache is set to false. This is useful for debugging purposes. It should probably be set to true under normal circumstances.

    <configuration>    
         <configSections>
               ...
              <section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler,dotless.Core" />
          </configSections>
    
          <dotless minifyCss="false" cache="false" 
                logger="dotless.Core.Loggers.AspResponseLogger" />
           ...    
    </configuration>