14
dotless documentation是相当有限的。我无法找到关于configsection选项的大量信息 - 特别是“web”属性的作用。DotLess的“web”属性到底做了什么?
任何人都可以启发我吗?
dotless documentation是相当有限的。我无法找到关于configsection选项的大量信息 - 特别是“web”属性的作用。DotLess的“web”属性到底做了什么?
任何人都可以启发我吗?
的代码通常是相当不错的文档开源项目;)
抢代码的副本,并期待在dotless.Core>配置> DotlessConfiguration.cs你会看到所有的配置元素一些方便评论 - 这是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上下文)
感谢您的回答凯文。你是对的 - 我应该看看源头。 ) – cjacques
当您使用Nuget安装dotless时,它会将此行添加到您的web.config文件中:' '。为什么会默认'web =“false”?似乎违反直觉。 –
d512