Repository: Azure/azure-sdk-for-net
Pull request #48547: Upgrading BCL packages pt. 1
Author: login: m-redding
Created: 2025-03-04T18:05:37Z | Merged: 2025-03-28T20:32:18Z

We need to upgrade our dependencies on BCL packages as part of https://github.com/Azure/azure-sdk-for-net/issues/46639

Because of transitive dependency conflicts, we'll need to do this over a few releases. This PR is preparing for the upgrade of System.Text.Json by upgrading the common dependencies of Azure.Core and System.Text.Json.


Diff:
diff --git a/common/Perf/Azure.Test.Perf/Azure.Test.Perf.csproj b/common/Perf/Azure.Test.Perf/Azure.Test.Perf.csproj
index b8bc428847ea..90979d773ed0 100644
--- a/common/Perf/Azure.Test.Perf/Azure.Test.Perf.csproj
+++ b/common/Perf/Azure.Test.Perf/Azure.Test.Perf.csproj
@@ -9,7 +9,6 @@
     <PackageReference Include="CommandLineParser" />
     <PackageReference Include="System.Reflection.Emit" />
     <PackageReference Include="System.Text.Json" />
-    <PackageReference Include="System.Text.Encodings.Web" />
     <PackageReference Include="System.Threading.Channels" />
     <PackageReference Include="BenchmarkDotNet" />
     <PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props
index a35a9fd5a34d..69cb6db94506 100644
--- a/eng/Packages.Data.props
+++ b/eng/Packages.Data.props
@@ -99,9 +99,9 @@
     <PackageReference Update="System.Threading.Channels" Version="6.0.0" />
     <PackageReference Update="System.Threading.Tasks.Extensions" Version="4.5.4" />
     <PackageReference Update="System.Text.Json" Version="6.0.11" />
-    <PackageReference Update="System.Text.Encodings.Web" Version="6.0.1" />
+    <PackageReference Update="System.Text.Encodings.Web" Version="8.0.0" />
     <PackageReference Update="System.ValueTuple" Version="4.5.0" />
-    <PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
+    <PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
     <PackageReference Update="Microsoft.CSharp" Version="4.7.0" />
 		<PackageReference Update="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0"/>
 
diff --git a/sdk/digitaltwins/Azure.DigitalTwins.Core/samples/DigitalTwinsClientSample/DigitalTwinsClientSample.csproj b/sdk/digitaltwins/Azure.DigitalTwins.Core/samples/DigitalTwinsClientSample/DigitalTwinsClientSample.csproj
index 86025b8512d2..4996163ea0a0 100644
--- a/sdk/digitaltwins/Azure.DigitalTwins.Core/samples/DigitalTwinsClientSample/DigitalTwinsClientSample.csproj
+++ b/sdk/digitaltwins/Azure.DigitalTwins.Core/samples/DigitalTwinsClientSample/DigitalTwinsClientSample.csproj
@@ -17,7 +17,7 @@
     <PackageReference Include="CommandLineParser" Version="2.7.82" />
     <PackageReference Include="Azure.Storage.Blobs" Version="12.16.0" />
 
-    <PackageReference Include="System.Text.Json" Version="6.0.11" />
+    <PackageReference Include="System.Text.Json" Version="8.0.5" />
   </ItemGroup>
 
   <ItemGroup>
diff --git a/sdk/monitor/Azure.Monitor.Ingestion/api/Azure.Monitor.Ingestion.net462.cs b/sdk/monitor/Azure.Monitor.Ingestion/api/Azure.Monitor.Ingestion.net462.cs
new file mode 100644
index 000000000000..00b8cd4568de
--- /dev/null
+++ b/sdk/monitor/Azure.Monitor.Ingestion/api/Azure.Monitor.Ingestion.net462.cs
@@ -0,0 +1,63 @@
+namespace Azure.Monitor.Ingestion
+{
+    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+    public readonly partial struct LogsIngestionAudience : System.IEquatable<Azure.Monitor.Ingestion.LogsIngestionAudience>
+    {
+        private readonly object _dummy;
+        private readonly int _dummyPrimitive;
+        public LogsIngestionAudience(string value) { throw null; }
+        public static Azure.Monitor.Ingestion.LogsIngestionAudience AzureChina { get { throw null; } }
+        public static Azure.Monitor.Ingestion.LogsIngestionAudience AzureGovernment { get { throw null; } }
+        public static Azure.Monitor.Ingestion.LogsIngestionAudience AzurePublicCloud { get { throw null; } }
+        public bool Equals(Azure.Monitor.Ingestion.LogsIngestionAudience other) { throw null; }
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        public override bool Equals(object obj) { throw null; }
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        public override int GetHashCode() { throw null; }
+        public static bool operator ==(Azure.Monitor.Ingestion.LogsIngestionAudience left, Azure.Monitor.Ingestion.LogsIngestionAudience right) { throw null; }
+        public static implicit operator Azure.Monitor.Ingestion.LogsIngestionAudience (string value) { throw null; }
+        public static bool operator !=(Azure.Monitor.Ingestion.LogsIngestionAudience left, Azure.Monitor.Ingestion.LogsIngestionAudience right) { throw null; }
+        public override string ToString() { throw null; }
+    }
+    public partial class LogsIngestionClient
+    {
+        protected LogsIngestionClient() { }
+        public LogsIngestionClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { }
+        public LogsIngestionClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Monitor.Ingestion.LogsIngestionClientOptions options) { }
+        public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } }
+        public virtual Azure.Response Upload(string ruleId, string streamName, Azure.Core.RequestContent content, string contentEncoding = null, Azure.RequestContext context = null) { throw null; }
+        public virtual System.Threading.Tasks.Task<Azure.Response> UploadAsync(string ruleId, string streamName, Azure.Core.RequestContent content, string contentEncoding = null, Azure.RequestContext context = null) { throw null; }
+        public virtual System.Threading.Tasks.Task<Azure.Response> UploadAsync<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logs, Azure.Monitor.Ingestion.LogsUploadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+        public virtual Azure.Response Upload<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logs, Azure.Monitor.Ingestion.LogsUploadOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+    }
+    public partial class LogsIngestionClientOptions : Azure.Core.ClientOptions
+    {
+        public LogsIngestionClientOptions(Azure.Monitor.Ingestion.LogsIngestionClientOptions.ServiceVersion version = Azure.Monitor.Ingestion.LogsIngestionClientOptions.ServiceVersion.V2023_01_01) { }
+        public Azure.Monitor.Ingestion.LogsIngestionAudience? Audience { get { throw null; } set { } }
+        public enum ServiceVersion
+        {
+            V2023_01_01 = 1,
+        }
+    }
+    public partial class LogsUploadFailedEventArgs : Azure.SyncAsyncEventArgs
+    {
+        public LogsUploadFailedEventArgs(System.Collections.Generic.IEnumerable<object> failedLogs, System.Exception exception, bool isRunningSynchronously, System.Threading.CancellationToken cancellationToken) : base (default(bool), default(System.Threading.CancellationToken)) { }
+        public System.Exception Exception { get { throw null; } }
+        public System.Collections.Generic.IReadOnlyList<object> FailedLogs { get { throw null; } }
+    }
+    public partial class LogsUploadOptions
+    {
+        public LogsUploadOptions() { }
+        public int MaxConcurrency { get { throw null; } set { } }
+        public Azure.Core.Serialization.ObjectSerializer Serializer { get { throw null; } set { } }
+        public event Azure.Core.SyncAsyncEventHandler<Azure.Monitor.Ingestion.LogsUploadFailedEventArgs> UploadFailed { add { } remove { } }
+    }
+}
+namespace Microsoft.Extensions.Azure
+{
+    public static partial class IngestionClientBuilderExtensions
+    {
+        public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Monitor.Ingestion.LogsIngestionClient, Azure.Monitor.Ingestion.LogsIngestionClientOptions> AddLogsIngestionClient<TBuilder>(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; }
+        public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Monitor.Ingestion.LogsIngestionClient, Azure.Monitor.Ingestion.LogsIngestionClientOptions> AddLogsIngestionClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration<TConfiguration> { throw null; }
+    }
+}
diff --git a/sdk/monitor/Azure.Monitor.Ingestion/src/Azure.Monitor.Ingestion.csproj b/sdk/monitor/Azure.Monitor.Ingestion/src/Azure.Monitor.Ingestion.csproj
index ecdae295aa14..9ff5b350eccf 100644
--- a/sdk/monitor/Azure.Monitor.Ingestion/src/Azure.Monitor.Ingestion.csproj
+++ b/sdk/monitor/Azure.Monitor.Ingestion/src/Azure.Monitor.Ingestion.csproj
@@ -6,9 +6,10 @@
     <!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
     <ApiCompatVersion>1.1.2</ApiCompatVersion>
     <PackageTags>Azure Monitor Ingestion</PackageTags>
-    <TargetFrameworks>$(RequiredTargetFrameworks);net461</TargetFrameworks>
+    <TargetFrameworks>$(RequiredTargetFrameworks);net462</TargetFrameworks>
     <NoWarn>$(NoWarn);CA1835</NoWarn> <!--TODO: Suppressing warning in shared source-->
     <IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
+    <ApiCompatBaselineTargetFramework Condition="'$(TargetFramework)' == 'net462'">net461</ApiCompatBaselineTargetFramework>
   </PropertyGroup>
 
   <!-- Shared source from Azure.Core -->
diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/api/Azure.Messaging.ServiceBus.net8.0.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/api/Azure.Messaging.ServiceBus.net8.0.cs
index 73396d509a6f..f4fdbeb5f9c3 100644
--- a/sdk/servicebus/Azure.Messaging.ServiceBus/api/Azure.Messaging.ServiceBus.net8.0.cs
+++ b/sdk/servicebus/Azure.Messaging.ServiceBus/api/Azure.Messaging.ServiceBus.net8.0.cs
@@ -1037,12 +1037,10 @@ public static partial class ServiceBusClientBuilderExtensions
         public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClient, Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClientOptions> AddServiceBusAdministrationClientWithNamespace<TBuilder>(this TBuilder builder, string fullyQualifiedNamespace) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; }
         public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClient, Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClientOptions> AddServiceBusAdministrationClient<TBuilder>(this TBuilder builder, string connectionString) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; }
         [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
         public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClient, Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClientOptions> AddServiceBusAdministrationClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration<TConfiguration> { throw null; }
         public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Messaging.ServiceBus.ServiceBusClient, Azure.Messaging.ServiceBus.ServiceBusClientOptions> AddServiceBusClientWithNamespace<TBuilder>(this TBuilder builder, string fullyQualifiedNamespace) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; }
         public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Messaging.ServiceBus.ServiceBusClient, Azure.Messaging.ServiceBus.ServiceBusClientOptions> AddServiceBusClient<TBuilder>(this TBuilder builder, string connectionString) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; }
         [System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
-        [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
         public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Messaging.ServiceBus.ServiceBusClient, Azure.Messaging.ServiceBus.ServiceBusClientOptions> AddServiceBusClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration<TConfiguration> { throw null; }
     }
 }
diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/stress/src/Azure.Messaging.ServiceBus.Stress.csproj b/sdk/servicebus/Azure.Messaging.ServiceBus/stress/src/Azure.Messaging.ServiceBus.Stress.csproj
index 807921858428..81eb4287938c 100644
--- a/sdk/servicebus/Azure.Messaging.ServiceBus/stress/src/Azure.Messaging.ServiceBus.Stress.csproj
+++ b/sdk/servicebus/Azure.Messaging.ServiceBus/stress/src/Azure.Messaging.ServiceBus.Stress.csproj
@@ -7,7 +7,6 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="System.Memory.Data" />
     <PackageReference Include="Azure.Storage.Blobs" />
     <PackageReference Include="Microsoft.ApplicationInsights" />
     <PackageReference Include="CommandLineParser" />
diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Azure.Messaging.ServiceBus.Tests.csproj b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Azure.Messaging.ServiceBus.Tests.csproj
index 6880e6d8e672..da8bb085d9db 100755
--- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Azure.Messaging.ServiceBus.Tests.csproj
+++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Azure.Messaging.ServiceBus.Tests.csproj
@@ -26,7 +26,6 @@
     <PackageReference Include="Moq" />
     <PackageReference Include="Polly" />
     <PackageReference Include="System.Threading.Tasks.Extensions" />
-    <PackageReference Include="System.Memory.Data" />
     <PackageReference Include="Azure.Storage.Blobs" />
   </ItemGroup>
 
diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToAllAction.cs b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToAllAction.cs
index 99d18cf7b24d..cc3acbb14787 100644
--- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToAllAction.cs
+++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToAllAction.cs
@@ -15,7 +15,7 @@ public sealed class SendToAllAction : WebPubSubAction
         /// <summary>
         /// Message to broadcast.
         /// </summary>
-        [JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonConverter(typeof(System.BinaryDataJsonConverter))]
         public BinaryData Data { get; set; }
 
         /// <summary>
diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToConnectionAction.cs b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToConnectionAction.cs
index fc3ada460904..4435a364f4ee 100644
--- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToConnectionAction.cs
+++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToConnectionAction.cs
@@ -19,7 +19,7 @@ public class SendToConnectionAction : WebPubSubAction
         /// <summary>
         /// Message to send.
         /// </summary>
-        [JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonConverter(typeof(System.BinaryDataJsonConverter))]
         public BinaryData Data { get; set; }
 
         /// <summary>
diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToGroupAction.cs b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToGroupAction.cs
index 206343a4302b..da09f5aba09c 100644
--- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToGroupAction.cs
+++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToGroupAction.cs
@@ -20,7 +20,7 @@ public class SendToGroupAction : WebPubSubAction
         /// <summary>
         /// Message to send.
         /// </summary>
-        [JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonConverter(typeof(System.BinaryDataJsonConverter))]
         public BinaryData Data { get; set; }
 
         /// <summary>
diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToUserAction.cs b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToUserAction.cs
index 0c84f928c956..61ff346e5173 100644
--- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToUserAction.cs
+++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToUserAction.cs
@@ -19,7 +19,7 @@ public sealed class SendToUserAction : WebPubSubAction
         /// <summary>
         /// Message to send.
         /// </summary>
-        [JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonConverter(typeof(System.BinaryDataJsonConverter))]
         public BinaryData Data { get; set; }
 
         /// <summary>
diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Trigger/UserEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Trigger/UserEventRequest.cs
index bfdc620dda59..444ed960e689 100644
--- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Trigger/UserEventRequest.cs
+++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Trigger/UserEventRequest.cs
@@ -14,7 +14,7 @@ public sealed class UserEventRequest : WebPubSubEventRequest
         /// <summary>
         /// Message content.
         /// </summary>
-        [JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonConverter(typeof(System.BinaryDataJsonConverter))]
         [JsonPropertyName("data")]
         public BinaryData Data { get; set; }
 
diff --git a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Trigger/UserEventResponse.cs b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Trigger/UserEventResponse.cs
index 92c57e61f482..a6c18593cd18 100644
--- a/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Trigger/UserEventResponse.cs
+++ b/sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Trigger/UserEventResponse.cs
@@ -44,7 +44,7 @@ internal override WebPubSubStatusCode StatusCode
         /// Message.
         /// </summary>
         [JsonPropertyName("data")]
-        [JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonConverter(typeof(System.BinaryDataJsonConverter))]
         public BinaryData Data { get; set; }
 
         /// <summary>
diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/api/Microsoft.Azure.WebPubSub.AspNetCore.net8.0.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/api/Microsoft.Azure.WebPubSub.AspNetCore.net8.0.cs
new file mode 100644
index 000000000000..715c6088e618
--- /dev/null
+++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/api/Microsoft.Azure.WebPubSub.AspNetCore.net8.0.cs
@@ -0,0 +1,49 @@
+namespace Microsoft.AspNetCore.Builder
+{
+    public static partial class WebPubSubEndpointRouteBuilderExtensions
+    {
+        public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapWebPubSubHub<THub>(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string path) where THub : Microsoft.Azure.WebPubSub.AspNetCore.WebPubSubHub { throw null; }
+        public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapWebPubSubHub<THub>(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string path, string hubName) where THub : Microsoft.Azure.WebPubSub.AspNetCore.WebPubSubHub { throw null; }
+    }
+}
+namespace Microsoft.Azure.WebPubSub.AspNetCore
+{
+    public partial class MqttConnectionException : System.Exception
+    {
+        public MqttConnectionException(Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponse mqttErrorResponse) { }
+    }
+    public abstract partial class WebPubSubHub
+    {
+        protected WebPubSubHub() { }
+        public virtual System.Threading.Tasks.ValueTask<Microsoft.Azure.WebPubSub.Common.ConnectEventResponse> OnConnectAsync(Microsoft.Azure.WebPubSub.Common.ConnectEventRequest request, System.Threading.CancellationToken cancellationToken) { throw null; }
+        public virtual System.Threading.Tasks.Task OnConnectedAsync(Microsoft.Azure.WebPubSub.Common.ConnectedEventRequest request) { throw null; }
+        public virtual System.Threading.Tasks.Task OnDisconnectedAsync(Microsoft.Azure.WebPubSub.Common.DisconnectedEventRequest request) { throw null; }
+        public virtual System.Threading.Tasks.ValueTask<Microsoft.Azure.WebPubSub.Common.UserEventResponse> OnMessageReceivedAsync(Microsoft.Azure.WebPubSub.Common.UserEventRequest request, System.Threading.CancellationToken cancellationToken) { throw null; }
+    }
+    public partial class WebPubSubOptions
+    {
+        public WebPubSubOptions() { }
+        public Microsoft.Azure.WebPubSub.AspNetCore.WebPubSubServiceEndpoint ServiceEndpoint { get { throw null; } set { } }
+    }
+    public partial class WebPubSubServiceClient<THub> : Azure.Messaging.WebPubSub.WebPubSubServiceClient where THub : Microsoft.Azure.WebPubSub.AspNetCore.WebPubSubHub
+    {
+        protected WebPubSubServiceClient() { }
+    }
+    public partial class WebPubSubServiceEndpoint
+    {
+        public WebPubSubServiceEndpoint(string connectionString, Azure.Messaging.WebPubSub.WebPubSubServiceClientOptions clientOptions = null) { }
+        public WebPubSubServiceEndpoint(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Messaging.WebPubSub.WebPubSubServiceClientOptions clientOptions = null) { }
+        public WebPubSubServiceEndpoint(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Messaging.WebPubSub.WebPubSubServiceClientOptions clientOptions = null) { }
+        public Azure.Messaging.WebPubSub.WebPubSubServiceClientOptions ClientOptions { get { throw null; } }
+        public System.Uri Endpoint { get { throw null; } }
+    }
+}
+namespace Microsoft.Extensions.DependencyInjection
+{
+    public static partial class WebPubSubDependencyInjectionExtensions
+    {
+        public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWebPubSub(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) { throw null; }
+        public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWebPubSub(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<Microsoft.Azure.WebPubSub.AspNetCore.WebPubSubOptions> configure) { throw null; }
+        public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWebPubSubServiceClient<THub>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where THub : Microsoft.Azure.WebPubSub.AspNetCore.WebPubSubHub { throw null; }
+    }
+}
diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/ServiceRequestHandlerAdapter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/ServiceRequestHandlerAdapter.cs
index 9ca6bd5689e5..ab30eeb1ecc4 100644
--- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/ServiceRequestHandlerAdapter.cs
+++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/ServiceRequestHandlerAdapter.cs
@@ -104,7 +104,7 @@ public async Task HandleRequest(HttpContext context)
                         {
                             if (preflightRequest.IsValid)
                             {
-                                context.Response.Headers.Add(Constants.Headers.WebHookAllowedOrigin, Constants.AllowedAllOrigins);
+                                context.Response.Headers.Append(Constants.Headers.WebHookAllowedOrigin, Constants.AllowedAllOrigins);
                                 break;
                             }
                             context.Response.StatusCode = StatusCodes.Status400BadRequest;
@@ -231,7 +231,7 @@ private static void SetConnectionState(ref HttpContext context, WebPubSubConnect
             var updatedStates = connectionContext.UpdateStates(newStates);
             if (updatedStates != null)
             {
-                context.Response.Headers.Add(Constants.Headers.CloudEvents.State, updatedStates.EncodeConnectionStates());
+                context.Response.Headers.Append(Constants.Headers.CloudEvents.State, updatedStates.EncodeConnectionStates());
             }
         }
 
diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/WebPubSubMiddleware.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/WebPubSubMiddleware.cs
index bbb5f5f08235..9c55f28d1818 100644
--- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/WebPubSubMiddleware.cs
+++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/WebPubSubMiddleware.cs
@@ -43,7 +43,7 @@ public async Task InvokeAsync(HttpContext context)
                 Log.ReceivedAbuseProtectionRequest(_logger);
                 if (_requestValidator.IsValidOrigin(requestOrigins))
                 {
-                    context.Response.Headers.Add(Constants.Headers.WebHookAllowedOrigin, Constants.AllowedAllOrigins);
+                    context.Response.Headers.Append(Constants.Headers.WebHookAllowedOrigin, Constants.AllowedAllOrigins);
                 }
                 else
                 {
diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Microsoft.Azure.WebPubSub.AspNetCore.csproj b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Microsoft.Azure.WebPubSub.AspNetCore.csproj
index ba71e0401452..462fdf530c4e 100644
--- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Microsoft.Azure.WebPubSub.AspNetCore.csproj
+++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Microsoft.Azure.WebPubSub.AspNetCore.csproj
@@ -6,10 +6,11 @@
     <!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
     <ApiCompatVersion>1.4.0</ApiCompatVersion>
     <PackageTags>Azure, WebPubSub</PackageTags>
-    <RequiredTargetFrameworks>netcoreapp3.1</RequiredTargetFrameworks>
+    <RequiredTargetFrameworks>net8.0</RequiredTargetFrameworks>
     <TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
     <NoWarn>$(NoWarn);419</NoWarn>
     <GenerateAPIListing>true</GenerateAPIListing>
+		<ApiCompatBaselineTargetFramework Condition="'$(TargetFramework)' == 'net8.0'">netcoreapp3.1</ApiCompatBaselineTargetFramework>
   </PropertyGroup>
 
   <ItemGroup>
diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/UserEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/UserEventRequest.cs
index b44a46800484..5027e5ea7f19 100644
--- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/UserEventRequest.cs
+++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/UserEventRequest.cs
@@ -17,7 +17,7 @@ public sealed class UserEventRequest : WebPubSubEventRequest
         /// Message content.
         /// </summary>
         [DataMember(Name = "data")]
-        [JsonPropertyName("data"), JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonPropertyName("data"), JsonConverter(typeof(System.BinaryDataJsonConverter))]
         public BinaryData Data { get; }
 
         /// <summary>
diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/UserEventResponse.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/UserEventResponse.cs
index bbaa951ce4e5..6a9960b3c17a 100644
--- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/UserEventResponse.cs
+++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/UserEventResponse.cs
@@ -50,7 +50,7 @@ internal override WebPubSubStatusCode StatusCode
         /// Message.
         /// </summary>
         [DataMember(Name = "data")]
-        [JsonPropertyName("data"), JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonPropertyName("data"), JsonConverter(typeof(System.BinaryDataJsonConverter))]
         public BinaryData Data { get; set; }
 
         /// <summary>


Reviews:
user: login: m-redding
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-19T00:20:37Z
user: login: m-redding
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-19T00:22:52Z
user: login: m-redding
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-19T00:24:07Z
user: login: Y-Sindo
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-21T07:27:33Z
user: login: jsquire
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-21T16:28:55Z
user: login: m-redding
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-21T17:40:33Z
user: login: m-redding
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-27T23:55:37Z
user: login: m-redding
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-27T23:57:49Z
user: login: jsquire
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-28T17:39:11Z
user: login: m-redding
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-28T19:52:34Z

Review comments:
diff_hunk: @@ -6,9 +6,10 @@
     <!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
     <ApiCompatVersion>1.1.2</ApiCompatVersion>
     <PackageTags>Azure Monitor Ingestion</PackageTags>
-    <TargetFrameworks>$(RequiredTargetFrameworks);net461</TargetFrameworks>
+    <TargetFrameworks>$(RequiredTargetFrameworks);net462</TargetFrameworks>
path: sdk/monitor/Azure.Monitor.Ingestion/src/Azure.Monitor.Ingestion.csproj
user: login: m-redding
body: 8.x packages weren't tested on net461 since it was deprecated. This leads to build errors if you try to depend on 8.x packages with a net461 target.
created_at: 2025-03-19T00:20:37Z
author_association: MEMBER
diff_hunk: @@ -15,7 +15,7 @@ public sealed class SendToAllAction : WebPubSubAction
         /// <summary>
         /// Message to broadcast.
         /// </summary>
-        [JsonConverter(typeof(BinaryDataJsonConverter))]
+        [JsonConverter(typeof(System.BinaryDataJsonConverter))]
path: sdk/webpubsub/Microsoft.Azure.Functions.Worker.Extensions.WebPubSub/src/Models/Output/SendToAllAction.cs
user: login: m-redding
body: This conflicts with https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.binarydatajsonconverter?view=net-9.0-pp so just explicitly sticking with the one defined in https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/BinaryDataJsonConverter.cs as per offline discussion
created_at: 2025-03-19T00:22:52Z
author_association: MEMBER
diff_hunk: @@ -6,10 +6,11 @@
     <!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
     <ApiCompatVersion>1.4.0</ApiCompatVersion>
     <PackageTags>Azure, WebPubSub</PackageTags>
-    <RequiredTargetFrameworks>netcoreapp3.1</RequiredTargetFrameworks>
+    <RequiredTargetFrameworks>net8.0</RequiredTargetFrameworks>
path: sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Microsoft.Azure.WebPubSub.AspNetCore.csproj
user: login: m-redding
body: Moving to latest LTS (one of the dependencies is not compatible with netstandard2.0 which is why this is different here I believe).
The 8.x packages weren't tested on netcoreapp3.1 since it's deprecated. Depending on 8.x packages with a netcoreapp3.1 target causes build errors, so the target needs to be bumped.
created_at: 2025-03-19T00:24:07Z
author_association: MEMBER
diff_hunk: @@ -99,9 +99,9 @@
     <PackageReference Update="System.Threading.Channels" Version="6.0.0" />
     <PackageReference Update="System.Threading.Tasks.Extensions" Version="4.5.4" />
     <PackageReference Update="System.Text.Json" Version="6.0.11" />
-    <PackageReference Update="System.Text.Encodings.Web" Version="6.0.1" />
+    <PackageReference Update="System.Text.Encodings.Web" Version="8.0.0" />
path: eng/Packages.Data.props
user: login: jsquire
body: I'm willing to bet that we can strip this out entirely.   I think it was only included in any project as a dependency because of a CVE that required we pull up the version used by STJ.    Can we test removing it, either here or as a later part of the process?
created_at: 2025-03-21T16:25:08Z
author_association: MEMBER
diff_hunk: @@ -17,7 +17,7 @@
     <PackageReference Include="CommandLineParser" Version="2.7.82" />
     <PackageReference Include="Azure.Storage.Blobs" Version="12.16.0" />
 
-    <PackageReference Include="System.Text.Json" Version="6.0.11" />
+    <PackageReference Include="System.Text.Json" Version="8.0.5" />
path: sdk/digitaltwins/Azure.DigitalTwins.Core/samples/DigitalTwinsClientSample/DigitalTwinsClientSample.csproj
user: login: jsquire
body: Can we please add a follow-up issue to review either removing this entirely or converting to use the central dependencies?
created_at: 2025-03-21T16:27:10Z
author_association: MEMBER
diff_hunk: @@ -6,9 +6,10 @@
     <!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
     <ApiCompatVersion>1.1.2</ApiCompatVersion>
     <PackageTags>Azure Monitor Ingestion</PackageTags>
-    <TargetFrameworks>$(RequiredTargetFrameworks);net461</TargetFrameworks>
+    <TargetFrameworks>$(RequiredTargetFrameworks);net462</TargetFrameworks>
path: sdk/monitor/Azure.Monitor.Ingestion/src/Azure.Monitor.Ingestion.csproj
user: login: jsquire
body: @nisha-bhatia, @scottaddie:  Any idea why we need an explicit target here rather than using `netstandard2.0`?
created_at: 2025-03-21T16:28:09Z
author_association: MEMBER
diff_hunk: @@ -99,9 +99,9 @@
     <PackageReference Update="System.Threading.Channels" Version="6.0.0" />
     <PackageReference Update="System.Threading.Tasks.Extensions" Version="4.5.4" />
     <PackageReference Update="System.Text.Json" Version="6.0.11" />
-    <PackageReference Update="System.Text.Encodings.Web" Version="6.0.1" />
+    <PackageReference Update="System.Text.Encodings.Web" Version="8.0.0" />
path: eng/Packages.Data.props
user: login: m-redding
body: Ah good point. Let me try
created_at: 2025-03-21T17:40:33Z
author_association: MEMBER
diff_hunk: @@ -99,9 +99,9 @@
     <PackageReference Update="System.Threading.Channels" Version="6.0.0" />
     <PackageReference Update="System.Threading.Tasks.Extensions" Version="4.5.4" />
     <PackageReference Update="System.Text.Json" Version="6.0.11" />
-    <PackageReference Update="System.Text.Encodings.Web" Version="6.0.1" />
+    <PackageReference Update="System.Text.Encodings.Web" Version="8.0.0" />
path: eng/Packages.Data.props
user: login: m-redding
body: I'm going to open a separate PR for simplifying dependency experimentation
created_at: 2025-03-27T23:55:37Z
author_association: MEMBER
diff_hunk: @@ -17,7 +17,7 @@
     <PackageReference Include="CommandLineParser" Version="2.7.82" />
     <PackageReference Include="Azure.Storage.Blobs" Version="12.16.0" />
 
-    <PackageReference Include="System.Text.Json" Version="6.0.11" />
+    <PackageReference Include="System.Text.Json" Version="8.0.5" />
path: sdk/digitaltwins/Azure.DigitalTwins.Core/samples/DigitalTwinsClientSample/DigitalTwinsClientSample.csproj
user: login: m-redding
body: https://github.com/Azure/azure-sdk-for-net/issues/49123
created_at: 2025-03-27T23:57:49Z
author_association: MEMBER
diff_hunk: @@ -17,7 +17,7 @@
     <PackageReference Include="CommandLineParser" Version="2.7.82" />
path: sdk/digitaltwins/Azure.DigitalTwins.Core/samples/DigitalTwinsClientSample/DigitalTwinsClientSample.csproj
user: login: jsquire
body: Feel free to just delete this sample.   The library has not been released in 3 years and no longer seems to be maintained.
created_at: 2025-03-28T17:27:43Z
author_association: MEMBER
diff_hunk: @@ -17,7 +17,7 @@
     <PackageReference Include="CommandLineParser" Version="2.7.82" />
path: sdk/digitaltwins/Azure.DigitalTwins.Core/samples/DigitalTwinsClientSample/DigitalTwinsClientSample.csproj
user: login: m-redding
body: Can do, will do that one in a separate PR too
created_at: 2025-03-28T19:52:34Z
author_association: MEMBER

PR comments:
user: login: azure-sdk
created_at: 2025-03-04T20:24:31Z
body: **API change check**

API changes are not detected in this pull request.
author_association: COLLABORATOR
user: login: scbedd
created_at: 2025-03-19T01:07:58Z
body: /azp run net - pullrequest
author_association: MEMBER
user: login: azure-pipelines[bot]
created_at: 2025-03-19T01:08:28Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: scbedd
created_at: 2025-03-19T18:38:56Z
body: /azp run net - pullrequest - ci
author_association: MEMBER
user: login: azure-pipelines[bot]
created_at: 2025-03-19T18:39:03Z
body: <samp>
No pipelines are associated with this pull request.<br>

</samp>
author_association: NONE
user: login: scbedd
created_at: 2025-03-19T18:39:05Z
body: /azp run net - monitor - ci
author_association: MEMBER
user: login: scbedd
created_at: 2025-03-19T18:39:17Z
body: /azp run net - pullrequest
author_association: MEMBER
user: login: azure-pipelines[bot]
created_at: 2025-03-19T18:39:31Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: azure-pipelines[bot]
created_at: 2025-03-19T18:39:40Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: nisha-bhatia
created_at: 2025-03-21T20:47:54Z
body: The Monitor tests have specific properties they test based on what framework  is running so I think we have just specified that in the .csproj.
author_association: CONTRIBUTOR
user: login: jsquire
created_at: 2025-03-21T20:52:09Z
body: > The Monitor tests have specific properties they test based on what framework is running so I think we have just specified that in the .csproj.

The tests don't need an explicit target in the library to know where they are running.   Unless I misunderstand what we're up to, it seems we should rethink this approach.
author_association: MEMBER
user: login: JoshLove-msft
created_at: 2025-03-21T21:03:24Z
body: > > The Monitor tests have specific properties they test based on what framework is running so I think we have just specified that in the .csproj.
> 
> The tests don't need an explicit target in the library to know where they are running. Unless I misunderstand what we're up to, it seems we should rethink this approach.

I think it was because of this - https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.Ingestion/src/GZipUtf8JsonRequestContent.cs#L99-L103
author_association: MEMBER
user: login: jsquire
created_at: 2025-03-21T21:33:22Z
body: > > > The Monitor tests have specific properties they test based on what framework is running so I think we have just specified that in the .csproj.
> > 
> > 
> > The tests don't need an explicit target in the library to know where they are running. Unless I misunderstand what we're up to, it seems we should rethink this approach.
> 
> I think it was because of this - https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.Ingestion/src/GZipUtf8JsonRequestContent.cs#L99-L103

Ok, that makes sense.   Looks like we'll want to keep that explicit target.
author_association: MEMBER
user: login: m-redding
created_at: 2025-03-28T20:31:32Z
body: Failure is unrelated to these changes: "sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/PlaywrightServiceOptions.cs(94,24): Error CS0618: 'VisualStudioCodeCredential' is obsolete" 
author_association: MEMBER
user: login: m-redding
created_at: 2025-03-28T20:31:41Z
body: /check-enforcer override
author_association: MEMBER