【发布时间】:2012-06-23 14:45:25
【问题描述】:
dotless documentation 非常有限。我根本找不到关于 configsection 选项的太多信息——尤其是“web”属性的作用。
谁能赐教?
【问题讨论】:
标签: asp.net web-config dotless
dotless documentation 非常有限。我根本找不到关于 configsection 选项的太多信息——尤其是“web”属性的作用。
谁能赐教?
【问题讨论】:
标签: asp.net web-config dotless
代码通常是开源项目的很好的文档;)
获取代码副本并查看 dotless.Core > configuration > DotlessConfiguration.cs,您将看到一些关于所有配置元素的便捷 cmets - 这是 Web 的
/// <summary>
/// Whether this is used in a web context or not
/// </summary>
public bool Web { get; set; }
诚然,它并没有告诉你很多信息,但找到对该属性的引用,你只会在代码中看到一个使用它的地方 -
if (!configuration.Web)
RegisterLocalServices(pandora);
这开始给你一个更好的线索来了解它是做什么的
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>();
}
所以它设置了内存缓存、记录到控制台等(即它使用的服务,如果不是在 Web 上下文中)
【讨论】:
<dotless minifyCss="false" cache="true" web="false" strictMath="false" />。为什么默认web="false"?似乎违反直觉。