diff --git a/sdk/core/Azure.Core/src/Azure.Core.csproj b/sdk/core/Azure.Core/src/Azure.Core.csproj
index 51ed3ced0b0a..7fc707df1015 100644
--- a/sdk/core/Azure.Core/src/Azure.Core.csproj
+++ b/sdk/core/Azure.Core/src/Azure.Core.csproj
@@ -16,7 +16,7 @@
netcoreapp2.1 is out of support but we'll keep is as a target for a bit
to give customers time to migrate without losing perf optimizations
-->
- $(NoWarn);NETSDK1138
+ $(NoWarn);NETSDK1138;NU1902;NU1903
net461
diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp.csproj
index 10e277de3e65..0264608177c1 100644
--- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp.csproj
+++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp.csproj
@@ -1,11 +1,11 @@
Exe
- net7.0;net6.0;net462
+ net8.0;net7.0;net6.0;net462
true
-
+
true
false
@@ -18,17 +18,8 @@
-
+
-
-
-
- <_NoWarn Include="$(NoWarn)" />
-
-
- @(_NoWarn)
-
-
diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/global.json b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/global.json
new file mode 100644
index 000000000000..3ecc5db745db
--- /dev/null
+++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/global.json
@@ -0,0 +1,5 @@
+{
+ "sdk": {
+ "version": "8.0.100-rc.2.23502.2"
+ }
+}
diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/test-aot-compat.ps1 b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/test-aot-compat.ps1
index 9cdefcd06480..b250a3067901 100644
--- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/test-aot-compat.ps1
+++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.AotCompatibilityTestApp/test-aot-compat.ps1
@@ -1,7 +1,8 @@
param([string]$targetNetFramework)
+dotnet clean
dotnet restore
-$publishOutput = dotnet publish --framework net7.0 -nodeReuse:false /p:UseSharedCompilation=false /p:ExposeExperimentalFeatures=true
+$publishOutput = dotnet publish --framework net8.0 -nodeReuse:false /p:UseSharedCompilation=false /p:ExposeExperimentalFeatures=true
if ($LASTEXITCODE -ne 0)
{
@@ -23,12 +24,12 @@ foreach ($line in $($publishOutput -split "`r`n"))
}
Write-Host "Actual warning count is:", $actualWarningCount
-$expectedWarningCount = 7
+$expectedWarningCount = 4
# Known warnings:
-# - Azure.Core.Serialization.DynamicData: Using member 'Azure.Core.Serialization.DynamicData.DynamicDataJsonConverter.DynamicDataJsonConverter()'
-# - 4x Azure.RequestFailedException.TryExtractErrorContent(): Using member 'System.Text.Json.JsonSerializer.Deserialize<>()' (https://github.com/Azure/azure-sdk-for-net/pull/38996)
-# - Azure.Core.Json.MutableJsonDocument: Using member 'Azure.Core.Json.MutableJsonDocument.MutableJsonDocumentConverter.MutableJsonDocumentConverter()'
-# - Microsoft.Extensions.DependencyInjection.ServiceLookup.IEnumerableCallSite.ServiceType.get: Using member 'System.Type.MakeGenericType(Type[])
+# - IL2026: Azure.Core.Serialization.DynamicData: Using member 'Azure.Core.Serialization.DynamicData.DynamicDataJsonConverter.DynamicDataJsonConverter()' which has 'RequiresUnreferencedCodeAttribute'
+# - IL3050: Azure.Core.Serialization.DynamicData: Using member 'Azure.Core.Serialization.DynamicData.DynamicDataJsonConverter.DynamicDataJsonConverter()' which has 'RequiresDynamicCodeAttribute'
+# - IL2026: Azure.Core.Json.MutableJsonDocument: Using member 'Azure.Core.Json.MutableJsonDocument.MutableJsonDocumentConverter.MutableJsonDocumentConverter()' which has 'RequiresUnreferencedCodeAttribute'
+# - IL3050: Azure.Core.Json.MutableJsonDocument: Using member 'Azure.Core.Json.MutableJsonDocument.MutableJsonDocumentConverter.MutableJsonDocumentConverter()' which has 'RequiresDynamicCodeAttribute'
$testPassed = 0
if ($actualWarningCount -ne $expectedWarningCount)