From 97e98158c7f64915d74ab724591378b2c7352ddb Mon Sep 17 00:00:00 2001 From: Miha Zupan Date: Mon, 3 Mar 2025 10:09:34 +0100 Subject: [PATCH 1/3] Update YARP NuGet references in Getting Started --- aspnetcore/fundamentals/servers/yarp/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/fundamentals/servers/yarp/getting-started.md b/aspnetcore/fundamentals/servers/yarp/getting-started.md index 740314ad5e3b..8022dd95fa63 100644 --- a/aspnetcore/fundamentals/servers/yarp/getting-started.md +++ b/aspnetcore/fundamentals/servers/yarp/getting-started.md @@ -19,7 +19,7 @@ We plan on providing a project template and pre-built exe in the future. YARP is implemented on top of .NET Core infrastructure and is usable on Windows, Linux or MacOS. Development can be done with the SDK and your favorite editor, [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/) or [Visual Studio Code](https://code.visualstudio.com/). -YARP 2.1.0 supports ASP.NET Core 6.0 and newer, including ASP.NET Core 8.0. +YARP 2.3.0 supports ASP.NET Core 8.0 and newer. You can download the .NET SDK from https://dotnet.microsoft.com/download/dotnet/. Visual Studio support for .NET 8 is included in Visual Studio 2022 17.8. @@ -40,7 +40,7 @@ Or create a new ASP.NET Core web application in Visual Studio 2022, and choose " ```XML - + ``` From c1046b2020d2e0a96e5e8e77834cdb3653d548cd Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Mon, 3 Mar 2025 10:36:27 -0500 Subject: [PATCH 2/3] Quick edit --- .../servers/yarp/getting-started.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/aspnetcore/fundamentals/servers/yarp/getting-started.md b/aspnetcore/fundamentals/servers/yarp/getting-started.md index 8022dd95fa63..45297c1c03c4 100644 --- a/aspnetcore/fundamentals/servers/yarp/getting-started.md +++ b/aspnetcore/fundamentals/servers/yarp/getting-started.md @@ -12,14 +12,12 @@ ai-usage: ai-assisted # Getting Started with YARP -YARP is designed as a library that provides the core proxy functionality which you can then customize by adding or replacing modules. -YARP is currently provided as a NuGet package and code snippets. -We plan on providing a project template and pre-built exe in the future. +YARP is designed as a library that provides the core proxy functionality which you can then customize by adding or replacing modules. YARP is currently provided as a NuGet package and code snippets. We plan on providing a project template and pre-built executable (`.exe`) in the future. -YARP is implemented on top of .NET Core infrastructure and is usable on Windows, Linux or MacOS. -Development can be done with the SDK and your favorite editor, [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/) or [Visual Studio Code](https://code.visualstudio.com/). +YARP is implemented on top of .NET Core infrastructure and is usable on Windows, Linux or MacOS. Development can be done with the SDK and your favorite editor, [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/) or [Visual Studio Code](https://code.visualstudio.com/). YARP 2.3.0 supports ASP.NET Core 8.0 and newer. + You can download the .NET SDK from https://dotnet.microsoft.com/download/dotnet/. Visual Studio support for .NET 8 is included in Visual Studio 2022 17.8. @@ -30,11 +28,11 @@ A complete version of the project built using the steps below can be found at [B Start by creating an "Empty" ASP.NET Core application using the command line: -```Console +```dotnetcli dotnet new web -n MyProxy -f net8.0 ``` -Or create a new ASP.NET Core web application in Visual Studio 2022, and choose "Empty" for the project template. +Alternatively, create a new ASP.NET Core web application in Visual Studio 2022, choosing "Empty" for the project template. ### Add the project reference @@ -48,7 +46,7 @@ Or create a new ASP.NET Core web application in Visual Studio 2022, and choose " Update Program.cs to use the YARP middleware: -```C# +```csharp var builder = WebApplication.CreateBuilder(args); builder.Services.AddReverseProxy() .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy")); @@ -59,11 +57,11 @@ app.Run(); ## Configuration -The configuration for YARP is defined in the appsettings.json file. See [Configuration Files](xref:fundamentals/servers/yarp/config-files) for details. +The configuration for YARP is defined in the `appsettings.json` file. For more information, see . -The configuration can also be provided programmatically. See [Configuration Providers](xref:fundamentals/servers/yarp/config-providers) for details. +The configuration can also be provided programmatically. For more information, see . -You can find out more about the available configuration options by looking at [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig) and [ClusterConfig](xref:Yarp.ReverseProxy.Configuration.ClusterConfig). +Learn more about the available configuration options by looking at and . ```JSON { From e9d2c8220b7ccc63a8dd0df0653df0f34288f0fe Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Mon, 3 Mar 2025 10:42:25 -0500 Subject: [PATCH 3/3] Updates --- .../servers/yarp/getting-started.md | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/aspnetcore/fundamentals/servers/yarp/getting-started.md b/aspnetcore/fundamentals/servers/yarp/getting-started.md index 45297c1c03c4..3c6d2700245d 100644 --- a/aspnetcore/fundamentals/servers/yarp/getting-started.md +++ b/aspnetcore/fundamentals/servers/yarp/getting-started.md @@ -12,7 +12,7 @@ ai-usage: ai-assisted # Getting Started with YARP -YARP is designed as a library that provides the core proxy functionality which you can then customize by adding or replacing modules. YARP is currently provided as a NuGet package and code snippets. We plan on providing a project template and pre-built executable (`.exe`) in the future. +YARP is designed as a library that provides the core proxy functionality which you can then customize by adding or replacing modules. YARP is currently provided as a NuGet package and code snippets. We plan on providing a project template and prebuilt executable (`.exe`) in the future. YARP is implemented on top of .NET Core infrastructure and is usable on Windows, Linux or MacOS. Development can be done with the SDK and your favorite editor, [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/) or [Visual Studio Code](https://code.visualstudio.com/). @@ -22,7 +22,7 @@ You can download the .NET SDK from https://dotnet.microsoft.com/download/dotnet/ Visual Studio support for .NET 8 is included in Visual Studio 2022 17.8. -### Create a new project +## Create a new project A complete version of the project built using the steps below can be found at [Basic YARP Sample](https://github.com/microsoft/reverse-proxy/tree/release/latest/samples/BasicYarpSample). @@ -34,17 +34,19 @@ dotnet new web -n MyProxy -f net8.0 Alternatively, create a new ASP.NET Core web application in Visual Studio 2022, choosing "Empty" for the project template. -### Add the project reference +## Add the package reference - ```XML - - - +Add a package reference for [`Yarp.ReverseProxy`](https://www.nuget.org/packages/Yarp.ReverseProxy), version 2.3.0 or later. + +```dotnetcli +dotnet add package Yarp.ReverseProxy ``` -### Add the YARP Middleware +[!INCLUDE[](~/includes/package-reference.md)] -Update Program.cs to use the YARP middleware: +## Add the YARP Middleware + +Update the `Program` file to use the YARP Middleware: ```csharp var builder = WebApplication.CreateBuilder(args); @@ -63,7 +65,7 @@ The configuration can also be provided programmatically. For more information, s Learn more about the available configuration options by looking at and . - ```JSON + ```json { "Logging": { "LogLevel": { @@ -95,6 +97,8 @@ Learn more about the available configuration options by looking at `. -Use `dotnet run` called within the sample's directory or `dotnet run --project ` +In Visual Studio, start the app with the **Run** button.