ApricotFramework.DiscoveryClient.Yaml
0.1.0
Prefix Reserved
dotnet add package ApricotFramework.DiscoveryClient.Yaml --version 0.1.0
NuGet\Install-Package ApricotFramework.DiscoveryClient.Yaml -Version 0.1.0
<PackageReference Include="ApricotFramework.DiscoveryClient.Yaml" Version="0.1.0" />
<PackageVersion Include="ApricotFramework.DiscoveryClient.Yaml" Version="0.1.0" />
<PackageReference Include="ApricotFramework.DiscoveryClient.Yaml" />
paket add ApricotFramework.DiscoveryClient.Yaml --version 0.1.0
#r "nuget: ApricotFramework.DiscoveryClient.Yaml, 0.1.0"
#:package ApricotFramework.DiscoveryClient.Yaml@0.1.0
#addin nuget:?package=ApricotFramework.DiscoveryClient.Yaml&version=0.1.0
#tool nuget:?package=ApricotFramework.DiscoveryClient.Yaml&version=0.1.0
ApricotFramework.DiscoveryClient
Service discovery for .NET without a discovery server: one declarative catalogue of services and ports, resolved to URLs differently on a laptop, in containers and in Kubernetes.
ApricotFramework.DiscoveryClient is the zero-dependency core.
Install
dotnet add package ApricotFramework.DiscoveryClient
dotnet add package ApricotFramework.DiscoveryClient.AspNetCore
dotnet add package ApricotFramework.DiscoveryClient.Yaml
Usage
# services.yaml — the catalogue, shared by every service that talks to these
services:
billing:
namespace: payments
ports:
- protocol: https
roles: [ 'api' ]
port: 11101
- protocol: https
roles: [ 'ui' ]
port: 11103
- protocol: https
roles: [ 'grpc' ]
port: 11105
overrides:
istio: # behind an ingress everything arrives on 443
ports:
- protocol: https
roles: [ 'api', 'grpc' ]
port: 443
// appsettings.json — the only thing that differs between environments
{
"StaticDiscovery": {
"HostingType": "k8s", // localhost | docker | docker_localhost | k8s
"Profile": "istio",
"DefaultProtocol": "https",
"DefaultGrpcProtocol": "https"
}
}
using ApricotFramework.DiscoveryClient.AspNetCore.Extensions;
builder.Services.AddServiceDefinitionsSource<CatalogueSource>();
builder.Services.AddDiscoveryClient(builder.Configuration);
// https://billing.payments.svc.cluster.local:443
await discovery.GetApiBase("billing");
// https://billing.payments.svc.cluster.local:443/v1/invoices
await discovery.GetApiUrl("billing", "/v1/invoices");
// The same catalogue with HostingType "localhost" gives https://localhost:11101 — no code changes,
// and an unknown service is a null rather than an exception.
A profile's ports are appended to the service's own, and the last port matching a protocol and
role wins. That is what makes an override take effect, and it means an override that says nothing
about a role leaves that role on the service's own port — ui above is still reachable on 11103 under
the istio profile.
Full documentation: https://projectapricot.dev
| Product | Versions 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. |
-
net10.0
- ApricotFramework.DiscoveryClient (>= 0.1.0)
- YamlDotNet (>= 18.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 140 | 8/14/2026 |