diff --git a/.github/workflows/apicompatibility.yml b/.github/workflows/apicompatibility.yml
index ec6706fdfab..1242d3e5542 100644
--- a/.github/workflows/apicompatibility.yml
+++ b/.github/workflows/apicompatibility.yml
@@ -17,6 +17,9 @@ jobs:
with:
fetch-depth: 0 # fetching all
+ - name: Setup dotnet
+ uses: actions/setup-dotnet@v3
+
- name: Install dependencies
run: dotnet restore
diff --git a/.github/workflows/ci-aot.yml b/.github/workflows/ci-aot.yml
index 1be900f89ca..499813e3669 100644
--- a/.github/workflows/ci-aot.yml
+++ b/.github/workflows/ci-aot.yml
@@ -24,6 +24,9 @@ jobs:
with:
fetch-depth: 0 # fetching all
+ - name: Setup dotnet
+ uses: actions/setup-dotnet@v3
+
- name: publish AOT testApp, assert static analysis warning count, and run the app
shell: pwsh
run: .\build\test-aot-compatibility.ps1 ${{ matrix.version }}
diff --git a/.github/workflows/ci-instrumentation-libraries.yml b/.github/workflows/ci-instrumentation-libraries.yml
index 914f7efdad7..14da57a3298 100644
--- a/.github/workflows/ci-instrumentation-libraries.yml
+++ b/.github/workflows/ci-instrumentation-libraries.yml
@@ -31,6 +31,9 @@ jobs:
with:
fetch-depth: 0 # fetching all
+ - name: Setup dotnet
+ uses: actions/setup-dotnet@v3
+
- name: Install dependencies
run: dotnet restore ./build/InstrumentationLibraries.proj
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 734959b70de..3f532267044 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -27,6 +27,9 @@ jobs:
with:
fetch-depth: 0 # fetching all
+ - name: Setup dotnet
+ uses: actions/setup-dotnet@v3
+
- name: Install dependencies
run: dotnet restore
diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml
index 4a68cb93e41..571b6cf8f60 100644
--- a/.github/workflows/code-coverage.yml
+++ b/.github/workflows/code-coverage.yml
@@ -24,6 +24,9 @@ jobs:
with:
fetch-depth: 0 # fetching all
+ - name: Setup dotnet
+ uses: actions/setup-dotnet@v3
+
- name: Install dependencies
run: dotnet restore
diff --git a/.github/workflows/dotnet-format.yml b/.github/workflows/dotnet-format.yml
index 73c2cde0bdc..b6d974ced3c 100644
--- a/.github/workflows/dotnet-format.yml
+++ b/.github/workflows/dotnet-format.yml
@@ -20,6 +20,9 @@ jobs:
- name: check out code
uses: actions/checkout@v3
+ - name: Setup dotnet
+ uses: actions/setup-dotnet@v3
+
- name: Install format tool
run: dotnet tool install -g dotnet-format
diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln
index 12c17122b4e..4f269da2bd2 100644
--- a/OpenTelemetry.sln
+++ b/OpenTelemetry.sln
@@ -44,8 +44,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
build\process-codecoverage.ps1 = build\process-codecoverage.ps1
build\RELEASING.md = build\RELEASING.md
build\stylecop.json = build\stylecop.json
- build\xunit.runner.json = build\xunit.runner.json
build\test-aot-compatibility.ps1 = build\test-aot-compatibility.ps1
+ build\xunit.runner.json = build\xunit.runner.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Zipkin", "src\OpenTelemetry.Exporter.Zipkin\OpenTelemetry.Exporter.Zipkin.csproj", "{7EDAE7FA-B44E-42CA-80FA-7DF2FAA2C5DD}"
@@ -97,6 +97,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
ProjectSection(SolutionItems) = preProject
.github\workflows\apicompatibility.yml = .github\workflows\apicompatibility.yml
.github\workflows\ci-aot.yml = .github\workflows\ci-aot.yml
+ .github\workflows\ci-instrumentation-libraries-md.yml = .github\workflows\ci-instrumentation-libraries-md.yml
+ .github\workflows\ci-instrumentation-libraries.yml = .github\workflows\ci-instrumentation-libraries.yml
.github\workflows\ci-md.yml = .github\workflows\ci-md.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\code-coverage.yml = .github\workflows\code-coverage.yml
diff --git a/build/Common.props b/build/Common.props
index cf2ac9deb25..c76d4fc1d51 100644
--- a/build/Common.props
+++ b/build/Common.props
@@ -6,6 +6,7 @@
$(MSBuildThisFileDirectory)debug.snk
$(DefineConstants);SIGNED
true
+ true
enable
enable
diff --git a/build/docker-compose.net6.0.yml b/build/docker-compose.net6.0.yml
index 8cccc8ee518..23d0640fe6c 100644
--- a/build/docker-compose.net6.0.yml
+++ b/build/docker-compose.net6.0.yml
@@ -6,4 +6,4 @@ services:
args:
PUBLISH_FRAMEWORK: net6.0
TEST_SDK_VERSION: "6.0"
- BUILD_SDK_VERSION: "7.0.306"
+ BUILD_SDK_VERSION: "7.0"
diff --git a/build/docker-compose.net7.0.yml b/build/docker-compose.net7.0.yml
index add02e8b47b..6f558d8fac4 100644
--- a/build/docker-compose.net7.0.yml
+++ b/build/docker-compose.net7.0.yml
@@ -6,4 +6,4 @@ services:
args:
PUBLISH_FRAMEWORK: net7.0
TEST_SDK_VERSION: "7.0"
- BUILD_SDK_VERSION: "7.0.306"
+ BUILD_SDK_VERSION: "7.0"
diff --git a/docs/metrics/getting-started-aspnetcore/Program.cs b/docs/metrics/getting-started-aspnetcore/Program.cs
index 835703f0c81..98c7e98b343 100644
--- a/docs/metrics/getting-started-aspnetcore/Program.cs
+++ b/docs/metrics/getting-started-aspnetcore/Program.cs
@@ -14,7 +14,6 @@
// limitations under the License.
//
-using System.Diagnostics;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
diff --git a/docs/trace/getting-started-jaeger/Program.cs b/docs/trace/getting-started-jaeger/Program.cs
index b57660f7470..c8c4e666b30 100644
--- a/docs/trace/getting-started-jaeger/Program.cs
+++ b/docs/trace/getting-started-jaeger/Program.cs
@@ -14,12 +14,8 @@
// limitations under the License.
//
-using System;
using System.Diagnostics;
-using System.Net.Http;
-using System.Threading.Tasks;
using OpenTelemetry;
-using OpenTelemetry.Exporter;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
diff --git a/global.json b/global.json
index 0f417661e6d..aeb8ae7b1ee 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
"rollForward": "latestFeature",
- "version": "7.0.101"
+ "version": "7.0.400"
}
}
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/BaseOtlpHttpExportClientTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/BaseOtlpHttpExportClientTests.cs
index ab5586c385e..6633924ef83 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/BaseOtlpHttpExportClientTests.cs
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/BaseOtlpHttpExportClientTests.cs
@@ -14,7 +14,9 @@
// limitations under the License.
//
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
using OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient;
using Xunit;
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/Implementation/ExportClient/OtlpHttpTraceExportClientTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/Implementation/ExportClient/OtlpHttpTraceExportClientTests.cs
index f0bfecb030b..38e9a95ea48 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/Implementation/ExportClient/OtlpHttpTraceExportClientTests.cs
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/Implementation/ExportClient/OtlpHttpTraceExportClientTests.cs
@@ -15,9 +15,8 @@
//
using System.Diagnostics;
-using System.Net.Http;
#if !NET6_0_OR_GREATER
-using System.Threading.Tasks;
+using System.Net.Http;
#endif
using Moq;
using Moq.Protected;
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/MockCollectorIntegrationTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/MockCollectorIntegrationTests.cs
index 0cad1f777cd..8f5c287d10d 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/MockCollectorIntegrationTests.cs
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/MockCollectorIntegrationTests.cs
@@ -15,11 +15,7 @@
//
#if !NETFRAMEWORK
-using System.Collections.Generic;
using System.Diagnostics;
-using System.Linq;
-using System.Net.Http;
-using System.Threading.Tasks;
using Grpc.Core;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@@ -69,13 +65,13 @@ public async Task TestRecoveryAfterFailedExport()
}))
.StartAsync().ConfigureAwait(false);
- var httpClient = new HttpClient() { BaseAddress = new System.Uri("http://localhost:5050") };
+ var httpClient = new HttpClient() { BaseAddress = new Uri("http://localhost:5050") };
var codes = new[] { Grpc.Core.StatusCode.Unimplemented, Grpc.Core.StatusCode.OK };
await httpClient.GetAsync($"/MockCollector/SetResponseCodes/{string.Join(",", codes.Select(x => (int)x))}").ConfigureAwait(false);
var exportResults = new List();
- var otlpExporter = new OtlpTraceExporter(new OtlpExporterOptions() { Endpoint = new System.Uri("http://localhost:4317") });
+ var otlpExporter = new OtlpTraceExporter(new OtlpExporterOptions() { Endpoint = new Uri("http://localhost:4317") });
var delegatingExporter = new DelegatingExporter
{
OnExportFunc = (batch) =>
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpExporterOptionsExtensionsTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpExporterOptionsExtensionsTests.cs
index 5b71306efeb..798cab42667 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpExporterOptionsExtensionsTests.cs
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpExporterOptionsExtensionsTests.cs
@@ -14,7 +14,6 @@
// limitations under the License.
//
-using Grpc.Core;
using OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient;
using Xunit;
using Xunit.Sdk;
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpLogExporterTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpLogExporterTests.cs
index 5125094074f..ed1aa8f5fc1 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpLogExporterTests.cs
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpLogExporterTests.cs
@@ -14,7 +14,6 @@
// limitations under the License.
//
-using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Reflection;
diff --git a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs
index c535121609d..1b44b854d3c 100644
--- a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs
+++ b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs
@@ -15,9 +15,6 @@
//
using System.Diagnostics.Metrics;
-#if NETFRAMEWORK
-using System.Linq;
-#endif
using OpenTelemetry.Metrics;
using OpenTelemetry.Tests;
using Xunit;
diff --git a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusHttpListenerTests.cs b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusHttpListenerTests.cs
index 7f7889af4e5..33180e8c14b 100644
--- a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusHttpListenerTests.cs
+++ b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusHttpListenerTests.cs
@@ -16,7 +16,9 @@
using System.Diagnostics.Metrics;
using System.Net;
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
using OpenTelemetry.Metrics;
using OpenTelemetry.Tests;
using Xunit;
diff --git a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs
index ef32ebc29bd..719bdc3ac29 100644
--- a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs
+++ b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs
@@ -17,7 +17,9 @@
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Net;
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
using System.Text;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
diff --git a/test/OpenTelemetry.Extensions.Hosting.Tests/InMemoryExporterMetricsExtensionsTests.cs b/test/OpenTelemetry.Extensions.Hosting.Tests/InMemoryExporterMetricsExtensionsTests.cs
index b1b9c86ae7c..0d686b895bd 100644
--- a/test/OpenTelemetry.Extensions.Hosting.Tests/InMemoryExporterMetricsExtensionsTests.cs
+++ b/test/OpenTelemetry.Extensions.Hosting.Tests/InMemoryExporterMetricsExtensionsTests.cs
@@ -16,11 +16,8 @@
#if NET6_0_OR_GREATER
-using System;
-using System.Collections.Generic;
using System.Diagnostics.Metrics;
using System.Net;
-using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ClientTestHelpers.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ClientTestHelpers.cs
index cdd6eb37eaf..f2b34dee76d 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ClientTestHelpers.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ClientTestHelpers.cs
@@ -14,7 +14,9 @@
// limitations under the License.
//
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
using System.Net.Http.Headers;
using Google.Protobuf;
using Grpc.Net.Compression;
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ResponseUtils.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ResponseUtils.cs
index 93d91ab35c9..9cc409885fb 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ResponseUtils.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/ResponseUtils.cs
@@ -17,7 +17,9 @@
using System.Buffers.Binary;
using System.Diagnostics;
using System.Net;
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
using System.Net.Http.Headers;
namespace OpenTelemetry.Instrumentation.Grpc.Tests.GrpcTestHelpers;
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TestHttpMessageHandler.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TestHttpMessageHandler.cs
index 6fb8ff727e8..e104f11acbc 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TestHttpMessageHandler.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TestHttpMessageHandler.cs
@@ -14,7 +14,9 @@
// limitations under the License.
//
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
namespace OpenTelemetry.Instrumentation.Grpc.Tests.GrpcTestHelpers;
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TrailingHeadersHelpers.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TrailingHeadersHelpers.cs
index 85e016566fc..8a4f00bdd8e 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TrailingHeadersHelpers.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTestHelpers/TrailingHeadersHelpers.cs
@@ -14,7 +14,9 @@
// limitations under the License.
//
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
using System.Net.Http.Headers;
namespace OpenTelemetry.Instrumentation.Grpc.Tests.GrpcTestHelpers;
diff --git a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs
index 2598106a702..407b6d9ab39 100644
--- a/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs
+++ b/test/OpenTelemetry.Instrumentation.Grpc.Tests/GrpcTests.client.cs
@@ -17,12 +17,16 @@
using System.Diagnostics;
using System.Net;
using Greet;
+#if !NETFRAMEWORK
using Grpc.Core;
+#endif
using Grpc.Net.Client;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Moq;
+#if !NETFRAMEWORK
using OpenTelemetry.Context.Propagation;
+#endif
using OpenTelemetry.Instrumentation.Grpc.Tests.GrpcTestHelpers;
using OpenTelemetry.Instrumentation.GrpcNetClient;
using OpenTelemetry.Instrumentation.GrpcNetClient.Implementation;
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.cs
index 5bb2e61620b..d7b41b75359 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.cs
@@ -17,8 +17,8 @@
using System.Diagnostics;
#if NETFRAMEWORK
using System.Net;
-#endif
using System.Net.Http;
+#endif
using Microsoft.Extensions.DependencyInjection;
using Moq;
using OpenTelemetry.Context.Propagation;
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs
index 2b0f0e6fe0c..0ceeaa1eb42 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs
@@ -15,7 +15,9 @@
//
using System.Diagnostics;
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
using System.Reflection;
using System.Text.Json;
using Moq;
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs
index 9cc64b81e2a..5ad9f6f2d69 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs
@@ -15,16 +15,10 @@
//
#if NETFRAMEWORK
-using System;
using System.Collections.Concurrent;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.IO;
-using System.Linq;
using System.Net;
using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
using OpenTelemetry.Instrumentation.Http.Implementation;
using OpenTelemetry.Tests;
using OpenTelemetry.Trace;
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTestsDupe.netfx.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTestsDupe.netfx.cs
index c58e18a285b..268f805d298 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTestsDupe.netfx.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTestsDupe.netfx.cs
@@ -15,16 +15,10 @@
//
#if NETFRAMEWORK
-using System;
using System.Collections.Concurrent;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.IO;
-using System.Linq;
using System.Net;
using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using OpenTelemetry.Instrumentation.Http.Implementation;
using OpenTelemetry.Tests;
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTestsNew.netfx.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTestsNew.netfx.cs
index 8df8faa2edd..48661f69100 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTestsNew.netfx.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTestsNew.netfx.cs
@@ -15,16 +15,10 @@
//
#if NETFRAMEWORK
-using System;
using System.Collections.Concurrent;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.IO;
-using System.Linq;
using System.Net;
using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using OpenTelemetry.Instrumentation.Http.Implementation;
using OpenTelemetry.Tests;
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.cs
index 2c598325602..85ab9988335 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.cs
@@ -16,9 +16,6 @@
using System.Diagnostics;
using System.Net;
-#if !NETFRAMEWORK
-using System.Net.Http;
-#endif
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Moq;
diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/RetryHandler.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/RetryHandler.cs
index 426e60e7216..1ba12c16768 100644
--- a/test/OpenTelemetry.Instrumentation.Http.Tests/RetryHandler.cs
+++ b/test/OpenTelemetry.Instrumentation.Http.Tests/RetryHandler.cs
@@ -14,7 +14,9 @@
// limitations under the License.
//
+#if NETFRAMEWORK
using System.Net.Http;
+#endif
namespace OpenTelemetry.Tests;
diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs
index cd238196b0d..7f3978429c1 100644
--- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs
+++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs
@@ -19,7 +19,9 @@
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry.Instrumentation.SqlClient.Implementation;
+#if !NETFRAMEWORK
using OpenTelemetry.Tests;
+#endif
using OpenTelemetry.Trace;
using Xunit;
diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs
index 3b60521456f..131f5622b02 100644
--- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs
+++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs
@@ -15,12 +15,10 @@
//
#if NETFRAMEWORK
-using System;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Diagnostics.Tracing;
-using System.Threading.Tasks;
using Moq;
using OpenTelemetry.Instrumentation.SqlClient.Implementation;
using OpenTelemetry.Tests;