15

The dotless documentation is quite limited. I can't find much information at all about the configsection options - especially what the "web" attribute does.

Can anyone enlighten me?

cjacques
  • 494
  • 4
  • 14

1 Answers1

19

The code is normally pretty good documentation for open source projects ;)

Grab a copy of the code and look in dotless.Core > configuration > DotlessConfiguration.cs you will see some handy comments about all the config elements - this is the Web one

/// <summary>
///  Whether this is used in a web context or not
/// </summary>
public bool Web { get; set; }

Admittedly it doesn't tell you a great deal but find the references to that property and you come across only one place in the code where it is used -

if (!configuration.Web)
    RegisterLocalServices(pandora);  

Which starts to give you a better clue as to what it does which is this

    protected virtual void RegisterLocalServices(FluentRegistration pandora)
    {
        pandora.Service<ICache>().Implementor<InMemoryCache>();
        pandora.Service<IParameterSource>().Implementor<ConsoleArgumentParameterSource>();
        pandora.Service<ILogger>().Implementor<ConsoleLogger>().Parameters("level").Set("error-level");
        pandora.Service<IPathResolver>().Implementor<RelativePathResolver>();
    }

So it sets up in memory caching, logging to the console etc (i.e services it uses if not in a web context)

Kevin Main
  • 2,334
  • 17
  • 28
  • 3
    Thanks for your answer Kevin. You're right - I should have had a look at the source. I still think their documentation could be better ;) – cjacques Jun 21 '12 at 13:09
  • 1
    When you install dotless using Nuget, it adds this line to your web.config file: ``. Why would `web="false"` by default? Seems counterintuitive. – d512 Sep 09 '16 at 05:08