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
                    
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="ApricotFramework.DiscoveryClient" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApricotFramework.DiscoveryClient" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ApricotFramework.DiscoveryClient" />
                    
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 ApricotFramework.DiscoveryClient --version 0.1.0
                    
#r "nuget: ApricotFramework.DiscoveryClient, 0.1.0"
                    
#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 ApricotFramework.DiscoveryClient@0.1.0
                    
#: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=ApricotFramework.DiscoveryClient&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ApricotFramework.DiscoveryClient&version=0.1.0
                    
Install as a Cake Tool

ApricotFramework.DiscoveryClient

NuGet NuGet NuGet CI License

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 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.
  • 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