Asp.net DotLess'&引用;“网络”;你到底是怎么做的?
这是非常有限的。我找不到关于configsection选项的更多信息,尤其是“web”属性的作用Asp.net DotLess'&引用;“网络”;你到底是怎么做的?,asp.net,web-config,dotless,Asp.net,Web Config,Dotless,这是非常有限的。我找不到关于configsection选项的更多信息,尤其是“web”属性的作用 有人能给我一些启发吗?这段代码通常是开源项目的很好的文档;) 抓取一份代码副本,在dotless.Core>configuration>DotlessConfiguration.cs中查看,您将看到一些关于所有配置元素的方便注释-这是Web注释 /// <summary> /// Whether this is used in a web context or not /// <
有人能给我一些启发吗?这段代码通常是开源项目的很好的文档;) 抓取一份代码副本,在dotless.Core>configuration>DotlessConfiguration.cs中查看,您将看到一些关于所有配置元素的方便注释-这是Web注释
/// <summary>
/// Whether this is used in a web context or not
/// </summary>
public bool Web { get; set; }
它开始给你一个更好的线索,关于它的作用,这是什么
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>();
}
受保护的虚拟无效注册表本地服务(FluentRegistration pandora)
{
pandora.Service().Implementor();
pandora.Service().Implementor();
pandora.Service().Implementor().Parameters(“level”).Set(“error level”);
pandora.Service().Implementor();
}
因此,它会设置内存缓存、登录到控制台等(即,如果不是在web环境中,它会使用服务)谢谢您的回答。你说得对,我应该看看消息来源。我仍然认为他们的文档可以更好;)使用Nuget安装dotless时,它会将以下行添加到web.config文件:
。为什么默认情况下web=“false”
?这似乎违反直觉。
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>();
}