ApricotFramework.DiscoveryClient
0.1.0
Prefix Reserved
dotnet add package ApricotFramework.DiscoveryClient --version 0.1.0
NuGet\Install-Package ApricotFramework.DiscoveryClient -Version 0.1.0
<PackageReference Include="ApricotFramework.DiscoveryClient" Version="0.1.0" />
<PackageVersion Include="ApricotFramework.DiscoveryClient" Version="0.1.0" />
<PackageReference Include="ApricotFramework.DiscoveryClient" />
paket add ApricotFramework.DiscoveryClient --version 0.1.0
#r "nuget: ApricotFramework.DiscoveryClient, 0.1.0"
#:package ApricotFramework.DiscoveryClient@0.1.0
#addin nuget:?package=ApricotFramework.DiscoveryClient&version=0.1.0
#tool nuget:?package=ApricotFramework.DiscoveryClient&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
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on ApricotFramework.DiscoveryClient:
| Package | Downloads |
|---|---|
|
ApricotFramework.DiscoveryClient.AspNetCore
ASP.NET Core integration for ApricotFramework.DiscoveryClient: binds the discovery settings from configuration, validates them when the host starts, and registers a client that picks up configuration reloads without a restart. |
|
|
ApricotFramework.DiscoveryClient.Yaml
YAML service catalogues for ApricotFramework.DiscoveryClient: load service definitions from a services.yaml file on disk, an embedded resource, or any stream. |
|
|
ApricotFramework.Grpc.Client.DiscoveryClient
Addresses gRPC clients by logical service name, resolving them through ApricotFramework.DiscoveryClient so a caller names the service it wants rather than a host and port. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 177 | 8/14/2026 |