Microsoft.Extensions.ServiceDiscovery.Yarp 10.5.0

Prefix Reserved
dotnet add package Microsoft.Extensions.ServiceDiscovery.Yarp --version 10.5.0
                    
NuGet\Install-Package Microsoft.Extensions.ServiceDiscovery.Yarp -Version 10.5.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="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="10.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="10.5.0" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery.Yarp" />
                    
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 Microsoft.Extensions.ServiceDiscovery.Yarp --version 10.5.0
                    
#r "nuget: Microsoft.Extensions.ServiceDiscovery.Yarp, 10.5.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 Microsoft.Extensions.ServiceDiscovery.Yarp@10.5.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=Microsoft.Extensions.ServiceDiscovery.Yarp&version=10.5.0
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.ServiceDiscovery.Yarp&version=10.5.0
                    
Install as a Cake Tool

Microsoft.Extensions.ServiceDiscovery.Yarp

The Microsoft.Extensions.ServiceDiscovery.Yarp library adds support for resolving endpoints for YARP clusters, by implementing a YARP destination resolver.

Usage

Resolving YARP cluster destinations using Service Discovery

The IReverseProxyBuilder.AddServiceDiscoveryDestinationResolver() extension method configures a YARP destination resolver. To use this method, you must also configure YARP itself as described in the YARP documentation, and you must configure .NET Service Discovery via the Microsoft.Extensions.ServiceDiscovery library.

Direct HTTP forwarding using Service Discovery Forwarding HTTP requests using IHttpForwarder

YARP supports direct forwarding of specific requests using the IHttpForwarder interface. This, too, can benefit from service discovery using the Microsoft.Extensions.ServiceDiscovery library. To take advantage of service discovery when using YARP Direct Forwarding, use the IServiceCollection.AddHttpForwarderWithServiceDiscovery method.

For example, consider the following .NET Aspire application:

var builder = WebApplication.CreateBuilder(args);

// Configure service discovery
builder.Services.AddServiceDiscovery();

// Add YARP Direct Forwarding with Service Discovery support
builder.Services.AddHttpForwarderWithServiceDiscovery();

// ... other configuration ...

var app = builder.Build();

// ... other configuration ...

// Map a Direct Forwarder which forwards requests to the resolved "catalogservice" endpoints
app.MapForwarder("/catalog/images/{id}", "http://catalogservice", "/api/v1/catalog/items/{id}/image");

app.Run();

In the above example, the YARP Direct Forwarder will resolve the catalogservice using service discovery, forwarding request sent to the /catalog/images/{id} endpoint to the destination path on the resolved endpoints.

Feedback & contributing

https://github.com/dotnet/aspire

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (8)

Showing the top 5 NuGet packages that depend on Microsoft.Extensions.ServiceDiscovery.Yarp:

Package Downloads
EraTech.Shared.Hosting.Settings.WebClients

Package Description

Nabs.Launchpad.Core.Gateway

Package Description

Aspirant.Hosting.Yarp

A custom YARP ingress resource for .NET Aspire App Host projects.

APF.Core.Clean.ApiGateway

Package Description

Nerdolando.Bff.AspNetCore

Library that provides a set of tools and components to help developers build Backend for Frontend (BFF) applications using ASP.NET Core. It aims to simplify the process of creating BFF layers by offering pre-built functionalities and best practices. This package is built on top of .NETCore and YARP and leverages Microsoft's OpenIdConnect library. It's been built also with best security practices in mind.

GitHub repositories (13)

Showing the top 13 popular GitHub repositories that depend on Microsoft.Extensions.ServiceDiscovery.Yarp:

Repository Stars
dotnet/eShop
A reference .NET application implementing an eCommerce site
dotnet/yarp
A toolkit for developing high-performance HTTP reverse proxy applications.
microsoft/aspire
Aspire is the tool for code-first, extensible, observable dev and deploy.
davidfowl/TodoApp
Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication
microsoft/aspire-samples
abpframework/eShopOnAbp
Reference microservice solution built with the ABP Framework and .NET, runs on Kubernetes with Helm configuration, includes API Gateways, Angular and ASP.NET Core MVC applications, PostgreSQL and MongoDB databases
mehmetozkaya/Design-Microservices-Architecture-with-Patterns-Principles
Design Microservices Architecture with Patterns & Principles. Design Microservices Architecture with Design Patterns, Principles and the Best Practices. How to handle millions of request with designing system for high availability, high scalability, low latency, and resilience to network failures on distributed microservices.
thangchung/practical-dotnet-aspire
The practical .NET Aspire builds on the coffeeshop app business domain
Azure-Samples/eShopOnAzure
A variant of https://github.com/dotnet/eShop that uses Azure services
anuviswan/LearningPoint
A repository for learning different technologies, frameworks, features......
dotnet-presentations/eshop-app-workshop
This workshop will teach you ASP.NET Core & .NET Aspire by building the product catalog & order placement features of the eShop reference application.
marinasundstrom/YourBrand
Prototype enterprise system for e-commerce and consulting services
PacktPublishing/Pragmatic-Microservices-with-CSharp-and-Azure
Pragmatic Microservices with C# and Azure, published by Packt
Version Downloads Last Updated
10.5.0 20,274 4/15/2026
10.4.0 59,460 3/10/2026
10.3.0 53,255 2/10/2026
10.2.0 52,753 1/13/2026
10.1.0 58,833 12/9/2025
10.0.0 66,647 11/11/2025
9.5.2 48,578 10/23/2025
9.5.1 33,835 10/3/2025
9.5.0 123,896 9/25/2025
9.4.2 39,727 9/2/2025
9.4.1 22,428 8/12/2025
9.4.0 34,405 7/29/2025
9.3.1 65,491 6/10/2025
9.3.0 49,981 5/19/2025
9.2.1 44,809 4/24/2025 9.2.1 is deprecated because it is no longer maintained.
9.2.0 19,639 4/10/2025 9.2.0 is deprecated because it is no longer maintained.
9.1.0 58,244 2/25/2025 9.1.0 is deprecated because it is no longer maintained.
9.0.0 150,218 11/12/2024 9.0.0 is deprecated because it is no longer maintained.
9.0.0-rc.1.24511.1 6,692 10/15/2024 9.0.0-rc.1.24511.1 is deprecated because it is no longer maintained.
8.2.2 124,386 10/24/2024 8.2.2 is deprecated because it is no longer maintained.
Loading failed