Zeek.Settings 10.0.39

Zeek.Settings

Zeek.Settings 是用户可写 settings 模块,负责桌面应用的本地用户设置读写、保存、重载、重置和字段保护。

默认模型是一份 appsettings.json:Core 负责启动时读取并提供 IConfigurationZeek.Settings 负责把已注册的强类型 settings section 写回同一份文件。文件 replace / move 是提交点;提交后的配置根刷新为 best-effort,失败不会反转磁盘和 typed snapshot 的成功结果。

适用场景

  • 保存用户偏好、窗口设置、最近路径、UI 选项等本地可写配置。
  • 需要 AOT 友好的 JsonTypeInfo<TSettings> settings 序列化。
  • 需要让 Core 启动读取、ISettings<T> 写回和 IConfiguration 原始观察围绕同一份 appsettings 文件工作。
  • 需要把用户可写 settings 与敏感凭据长期安全存储分工清楚。

安装 / 引用

<PackageReference Include="Zeek.Settings" />

快速开始

在根模块依赖 SettingsModule,并按正式文档显式注册 settings 类型和 JSON metadata。业务代码通过 ISettings<TSettings> 读取、更新和保存。

AOT / Trim

  • AOT 支持等级:Required。
  • Trim 策略:显式 settings 注册和显式 JsonTypeInfo<TSettings>
  • 反射策略:不依赖 runtime reflection JSON 作为主路径。

Sample

  • ../../samples/Zeek.SettingsSample/

完整文档

  • ../../docs/modules/Zeek.Settings.md

当前限制

  • 本模块不拥有、不替换 IConfigurationRoot
  • 本模块不引入第二个默认 settings.json,也不拥有文件路径入口;它直接使用 Core 的 ConfigurationFilePath
  • 本模块不负责远程配置中心、数据库配置、租户配置或敏感凭据长期安全存储。

No packages depend on Zeek.Settings.

Version Downloads Last updated
10.0.42 4 07/29/2026
10.0.41 15 07/22/2026
10.0.40 10 07/22/2026
10.0.39 19 07/19/2026
10.0.38 15 07/17/2026
10.0.37 1 07/16/2026
10.0.36 5 06/29/2026
10.0.35 1 06/29/2026
10.0.31 5 06/27/2026
10.0.30 2 06/27/2026
10.0.29 3 06/26/2026
10.0.28 2 06/26/2026
10.0.27 2 06/26/2026
10.0.26 4 06/25/2026
10.0.25 4 06/24/2026
10.0.24 7 06/20/2026
10.0.23 5 06/19/2026
10.0.22 7 06/18/2026
10.0.21 5 06/18/2026
10.0.20 9 06/17/2026
10.0.19 5 06/17/2026
10.0.18 8 06/16/2026
10.0.17 5 06/16/2026