From 0af272470ff1f2c18196e2feca3ebbbb5ae3cbd0 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Fri, 10 Nov 2023 08:40:10 +0000 Subject: [PATCH] Prevent server certificate callback runtime exception (#2213) * Prevent server certificate callback runtime exception On .NET Full framework <4.7.2, HttpClientHandler.ServerCertificateCustomValidationCallback is not available. Due to dependency binding issues introduced with netstandard, the incorrect System.Net.Http package may be resolved and lead to exceptions at runtime. This fix prevents calling this API on net462 targets which includes any .NET Framework version < .NET 4.7.2. This introduces the net472 target so that we can resume using this API from that version, where it was included in the box. * Update documentation * Tweak docs --- docs/configuration.asciidoc | 12 ++++++++++++ docs/setup-auto-instrumentation.asciidoc | 4 +++- docs/supported-technologies.asciidoc | 10 +++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/configuration.asciidoc b/docs/configuration.asciidoc index 676928f48..24f7c6b24 100644 --- a/docs/configuration.asciidoc +++ b/docs/configuration.asciidoc @@ -704,6 +704,12 @@ Verification can be disabled by changing this setting to false. | `true` | Boolean |============ +[NOTE] +==== +This configuration setting has no effect on .NET Framework versions 4.6.2-4.7.1. +We recommend upgrading to .NET Framework 4.7.2 or newer to use this configuration setting. +==== + [float] [[config-server-cert]] ==== `ServerCert` (added[1.9]) @@ -726,6 +732,12 @@ the trust store, such as a self-signed certificate. | `` | String |============ +[NOTE] +==== +This configuration setting has no effect on .NET Framework versions 4.6.2-4.7.1. +We recommend upgrading to .NET Framework 4.7.2 or newer to use this configuration setting. +==== + [float] [[config-flush-interval]] ==== `FlushInterval` (added[1.1]) diff --git a/docs/setup-auto-instrumentation.asciidoc b/docs/setup-auto-instrumentation.asciidoc index 738bebb17..5a3fcbc27 100644 --- a/docs/setup-auto-instrumentation.asciidoc +++ b/docs/setup-auto-instrumentation.asciidoc @@ -20,7 +20,7 @@ This approach works with the following |x64 -|.NET Framework 4.6.2+ +|.NET Framework 4.6.2+* .NET Core 2.1+ @@ -31,6 +31,8 @@ This approach works with the following .NET 5+ |=== +_* Due to binding issues introduced by Microsoft, we recommend at least .NET Framework 4.7.2 for best compatibility._ + NOTE: The Profiler based agent only supports 64-bit applications. 32-bit applications aren't supported. It instruments the following assemblies: diff --git a/docs/supported-technologies.asciidoc b/docs/supported-technologies.asciidoc index 77fabbf70..8576e9f63 100644 --- a/docs/supported-technologies.asciidoc +++ b/docs/supported-technologies.asciidoc @@ -28,7 +28,15 @@ the agent will not capture transactions. === .NET versions The agent works on every .NET flavor and version that supports .NET Standard 2.0. -This means .NET Core 2.0 or newer, and .NET Framework 4.6.2 or newer. +This means .NET Core 2.0 or newer, and .NET Framework 4.6.2* or newer. + +_* Due to binding issues introduced by Microsoft, we recommend at least .NET Framework 4.7.2 for best compatibility._ + +[IMPORTANT] +==== +While this library *should* work on .NET Core 2.0+, we limit our support to only those +versions currently supported by Microsoft - .NET 6.0 and newer. +==== [float] [[supported-web-frameworks]]