XiHan.Framework.Configuration.Abstractions 5.0.0-preview.1

Prefix Reserved
This is a prerelease version of XiHan.Framework.Configuration.Abstractions.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package XiHan.Framework.Configuration.Abstractions --version 5.0.0-preview.1
                    
NuGet\Install-Package XiHan.Framework.Configuration.Abstractions -Version 5.0.0-preview.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XiHan.Framework.Configuration.Abstractions" Version="5.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XiHan.Framework.Configuration.Abstractions" Version="5.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="XiHan.Framework.Configuration.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XiHan.Framework.Configuration.Abstractions --version 5.0.0-preview.1
                    
#r "nuget: XiHan.Framework.Configuration.Abstractions, 5.0.0-preview.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package XiHan.Framework.Configuration.Abstractions@5.0.0-preview.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XiHan.Framework.Configuration.Abstractions&version=5.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=XiHan.Framework.Configuration.Abstractions&version=5.0.0-preview.1&prerelease
                    
Install as a Cake Tool

XiHan.Framework.Configuration.Abstractions

配置契约(Ring 2,RFC-0014)。应用仍然读 Microsoft.Extensions.Configuration 的 IConfiguration;本包只定义两个 Provider 契约与把它们接进 IConfigurationBuilder 的配置源。默认实现是 .NET 原生的文件与环境变量,不设默认包。

能力 契约 配置源
configuration.remote@1 IRemoteConfigurationClient.FetchAsync(namespace, knownVersion) → Result<Maybe<ConfigurationDocument>>(未变化为无值,可长轮询) AddXiHanRemoteConfiguration(client, options)(客户端由调用方持有)或 AddXiHanRemoteConfiguration(clientFactory, options)(每个 Provider 按工厂新建一个,随它释放):首次同步加载(LoadTimeout),之后按 PollInterval 轮询(计时用 Clock),变化时整体替换并触发重载;失败保留最后一份成功的数据并回调 OnError
configuration.secrets@1 ISecretStore.GetAsync(names[]) 批量逐项 SecretLookup;SecretValue.ToString() 固定遮蔽 AddXiHanSecrets(store, options):Mappings 把配置键映射到密钥名,构建时一次批量读取,可按 RefreshInterval 重读(计时用 Clock)
builder.Configuration
    .AddXiHanRemoteConfiguration(() => NacosConfigurationClient.Create(nacosOptions), new RemoteConfigurationOptions("orders") { Prefix = "Orders", PollInterval = TimeSpan.FromSeconds(15) })
    .AddXiHanSecrets(vault, new SecretsConfigurationOptions(new Dictionary<string, SecretName>
    {
        ["ConnectionStrings:Orders"] = "orders/db-connection",
    }));

命名空间不存在 → CONFIGURATION_NOTFOUND_001;密钥不存在 → CONFIGURATION_NOTFOUND_002;不可达 → CONFIGURATION_UNAVAILABLE_001 / _002;无权限 → CONFIGURATION_DENIED_001。首次加载的失败(返回失败、超时、客户端或密钥库抛出异常、密钥库返回的条数与请求不一致)都先回调 OnError,Optional 为假时随后抛出 FrameworkException 让启动失败(抛出的异常作为内部异常),为真时为空并照常轮询或重读;重读时条数不一致同样回调并保留旧值。OnError 自己抛出的异常被丢弃,不改变加载结果、不终止轮询或重读(ADR-0068)。

依赖方向

依赖 XiHan.Framework.Primitives、XiHan.Framework.Localization.Abstractions 与 Microsoft.Extensions.Configuration.Abstractions(重载令牌用其传递依赖 Microsoft.Extensions.Primitives)。被 Configuration.Conformance 与各 Provider 引用。

状态

P3:可用。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on XiHan.Framework.Configuration.Abstractions:

Package Downloads
XiHan.Framework.Configuration.Conformance

曦寒框架配置一致性测试套件

XiHan.Framework.Profiles.Full

曦寒框架 Full 组合包

XiHan.Framework.Configuration.Nacos

曦寒框架配置的 Nacos 提供程序

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0-preview.2 48 11/6/2026
5.0.0-preview.1 56 11/4/2026