diff --git a/build/Common.nonprod.props b/build/Common.nonprod.props
index 8e50abe1da..54d1acd980 100644
--- a/build/Common.nonprod.props
+++ b/build/Common.nonprod.props
@@ -31,7 +31,6 @@
$(OpenTelemetryCoreLatestVersion)
net9.0;net8.0
- net8.0
[2.8.2,3.0)
[2.9.0,3.0)
[1.6.3,2.0)
diff --git a/test/OpenTelemetry.Resources.AWS.Tests/Http/ServerCertificateValidationProviderTests.cs b/test/OpenTelemetry.Resources.AWS.Tests/Http/ServerCertificateValidationProviderTests.cs
index c3164353be..7151659be8 100644
--- a/test/OpenTelemetry.Resources.AWS.Tests/Http/ServerCertificateValidationProviderTests.cs
+++ b/test/OpenTelemetry.Resources.AWS.Tests/Http/ServerCertificateValidationProviderTests.cs
@@ -23,7 +23,11 @@ public void TestValidCertificate()
Assert.NotNull(serverCertificateValidationProvider);
+#if NET9_0_OR_GREATER
+ var certificate = X509CertificateLoader.LoadCertificateFromFile(certificateUploader.FilePath);
+#else
var certificate = new X509Certificate2(certificateUploader.FilePath);
+#endif
X509Chain chain = new X509Chain();
chain.Build(certificate);
@@ -65,7 +69,12 @@ public void TestCallbackWithNullChain()
ServerCertificateValidationProvider.FromCertificateFile(certificateUploader.FilePath, NoopServerCertificateValidationEventSource.Instance);
Assert.NotNull(serverCertificateValidationProvider);
- Assert.False(serverCertificateValidationProvider.ValidationCallback(this, new X509Certificate2(certificateUploader.FilePath), null, default));
+#if NET9_0_OR_GREATER
+ var certificate = X509CertificateLoader.LoadCertificateFromFile(certificateUploader.FilePath);
+#else
+ var certificate = new X509Certificate2(certificateUploader.FilePath);
+#endif
+ Assert.False(serverCertificateValidationProvider.ValidationCallback(this, certificate, null, default));
}
}
diff --git a/test/OpenTelemetry.Resources.AWS.Tests/OpenTelemetry.Resources.AWS.Tests.csproj b/test/OpenTelemetry.Resources.AWS.Tests/OpenTelemetry.Resources.AWS.Tests.csproj
index dc0a10ebc8..8e2510fc3b 100644
--- a/test/OpenTelemetry.Resources.AWS.Tests/OpenTelemetry.Resources.AWS.Tests.csproj
+++ b/test/OpenTelemetry.Resources.AWS.Tests/OpenTelemetry.Resources.AWS.Tests.csproj
@@ -2,7 +2,7 @@
- $(SupportedNetTargetsWithoutNet9)
+ $(SupportedNetTargets)
$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)
Unit test project for AWS Detector for OpenTelemetry.