asp.net – DotLess的“web”属性究竟做了什么?

dotless documentation相当有限.关于配置选项,我找不到很多信息 – 特别是“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上下文中使用的服务)

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....