From 7352bd9d629c41d55b947c5f9ff5c651c4e4dd5e Mon Sep 17 00:00:00 2001 From: Iliar Turdushev Date: Tue, 18 Mar 2025 15:50:03 +0100 Subject: [PATCH] Fixes #5856 Update instructions how to fix a compatibility issue with App Insights --- src/Libraries/Microsoft.Extensions.Http.Resilience/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Libraries/Microsoft.Extensions.Http.Resilience/README.md b/src/Libraries/Microsoft.Extensions.Http.Resilience/README.md index b1d43b738a0..99a00a1db4e 100644 --- a/src/Libraries/Microsoft.Extensions.Http.Resilience/README.md +++ b/src/Libraries/Microsoft.Extensions.Http.Resilience/README.md @@ -105,7 +105,7 @@ There's a build time check that verifies if you're using `Grpc.Net.ClientFactory ### Compatibility with .NET Application Insights -If you're using .NET Application Insights, then enabling resilience functionality in your application could cause all Application Insights telemetry to be missing. The issue occurs when resilience functionality is registered before Application Insights services. Consider the following sample causing the issue: +If you're using .NET Application Insights version **2.22.0** or lower, then enabling resilience functionality in your application could cause all Application Insights telemetry to be missing. The issue occurs when resilience functionality is registered before Application Insights services. Consider the following sample causing the issue: ```csharp // At first, we register resilience functionality. @@ -115,7 +115,7 @@ services.AddHttpClient().AddStandardResilienceHandler(); services.AddApplicationInsightsTelemetry(); ``` -The issue is caused by the following [bug](https://github.com/microsoft/ApplicationInsights-dotnet/issues/2879) in Application Insights and can be fixed by registering Application Insights services before resilience functionality, as shown below: +The issue can be fixed by updating .NET Application Insights to version **2.23.0** or higher. If you cannot update it, then registering Application Insights services before resilience functionality, as shown below, will fix the issue: ```csharp // We register Application Insights first, and now it will be working correctly.