Browse Source

[main] Update dependencies from dotnet/runtime (#48407)

* Update dependencies from https://github.com/dotnet/runtime build 20230524.1

Microsoft.Bcl.AsyncInterfaces , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.DirectoryServices.Protocols , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
 From Version 8.0.0-preview.5.23273.1 -> To Version 8.0.0-preview.5.23274.1

* Use Microsoft.Extensions.Diaganostics

* Add to shared framework

* Add Diagnostics.Abstractions to shared fx.

* Remove InternalsVisibleTo workaround.

Add some dispose logic to TestMeterFactory.

* Fix test build. Add new assemblies to shared fx

* Fix new deps

* Update dependencies from https://github.com/dotnet/runtime build 20230524.13

Microsoft.Bcl.AsyncInterfaces , Microsoft.Bcl.TimeProvider , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Collections.Immutable , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
 From Version 8.0.0-preview.5.23273.1 -> To Version 8.0.0-preview.5.23274.13

* Update new dependencies to new runtime build

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: James Newton-King <[email protected]>
Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: wtgodbe <[email protected]>
dotnet-maestro[bot] 2 years ago
parent
commit
b9da6a0fa1
52 changed files with 380 additions and 652 deletions
  1. 2 0
      eng/Dependencies.props
  2. 2 0
      eng/SharedFramework.External.props
  3. 142 134
      eng/Version.Details.xml
  4. 69 67
      eng/Versions.props
  5. 4 0
      src/Framework/test/TestData.cs
  6. 1 0
      src/Hosting/Hosting/src/GenericHost/GenericWebHostBuilder.cs
  7. 1 0
      src/Hosting/Hosting/src/GenericHost/SlimWebHostBuilder.cs
  8. 2 2
      src/Hosting/Hosting/src/Internal/HostingMetrics.cs
  9. 1 0
      src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj
  10. 1 0
      src/Hosting/Hosting/src/WebHostBuilder.cs
  11. 7 7
      src/Hosting/Hosting/test/HostingApplicationDiagnosticsTests.cs
  12. 1 4
      src/Hosting/Hosting/test/HostingApplicationTests.cs
  13. 7 10
      src/Hosting/Hosting/test/HostingMetricsTests.cs
  14. 1 0
      src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj
  15. 0 23
      src/Http/Http.Abstractions/src/Microsoft.AspNetCore.Http.Abstractions.csproj
  16. 5 4
      src/Middleware/Diagnostics/test/UnitTests/DeveloperExceptionPageMiddlewareTest.cs
  17. 5 4
      src/Middleware/Diagnostics/test/UnitTests/ExceptionHandlerTest.cs
  18. 2 0
      src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj
  19. 1 0
      src/Middleware/RateLimiting/src/Microsoft.AspNetCore.RateLimiting.csproj
  20. 1 0
      src/Middleware/RateLimiting/src/RateLimiterServiceCollectionExtensions.cs
  21. 2 2
      src/Middleware/RateLimiting/src/RateLimitingMetrics.cs
  22. 2 1
      src/Middleware/RateLimiting/test/Microsoft.AspNetCore.RateLimiting.Tests.csproj
  23. 26 31
      src/Middleware/RateLimiting/test/RateLimitingMetricsTests.cs
  24. 0 1
      src/Middleware/RateLimiting/test/RateLimitingMiddlewareTests.cs
  25. 2 2
      src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelMetrics.cs
  26. 3 3
      src/Servers/Kestrel/Core/src/KestrelServer.cs
  27. 3 0
      src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj
  28. 0 1
      src/Servers/Kestrel/Core/test/KestrelServerTests.cs
  29. 1 0
      src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj
  30. 0 1
      src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs
  31. 1 0
      src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj
  32. 1 0
      src/Servers/Kestrel/perf/Microbenchmarks/Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks.csproj
  33. 0 1
      src/Servers/Kestrel/shared/test/TestContextFactory.cs
  34. 0 1
      src/Servers/Kestrel/shared/test/TestServiceContext.cs
  35. 2 2
      src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs
  36. 0 3
      src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs
  37. 0 7
      src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsTests.cs
  38. 1 0
      src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj
  39. 22 22
      src/Servers/Kestrel/test/InMemory.FunctionalTests/KestrelMetricsTests.cs
  40. 1 0
      src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj
  41. 1 0
      src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj
  42. 0 109
      src/Shared/Metrics/DefaultMeterFactory.cs
  43. 0 77
      src/Shared/Metrics/IMeterFactory.cs
  44. 0 69
      src/Shared/Metrics/InstrumentRecorder.cs
  45. 0 37
      src/Shared/Metrics/MetricsServiceExtensions.cs
  46. 45 16
      src/Shared/Metrics/TestMeterFactory.cs
  47. 2 2
      src/SignalR/common/Http.Connections/src/Internal/HttpConnectionsMetrics.cs
  48. 1 0
      src/SignalR/common/Http.Connections/src/Microsoft.AspNetCore.Http.Connections.csproj
  49. 3 4
      src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs
  50. 4 5
      src/SignalR/common/Http.Connections/test/HttpConnectionManagerTests.cs
  51. 1 0
      src/SignalR/common/Http.Connections/test/Microsoft.AspNetCore.Http.Connections.Tests.csproj
  52. 1 0
      src/SignalR/server/SignalR/src/SignalRDependencyInjectionExtensions.cs

+ 2 - 0
eng/Dependencies.props

@@ -40,6 +40,8 @@ and are generated based on the last package release.
     <LatestPackageReference Include="Microsoft.Extensions.DependencyInjection" />
     <LatestPackageReference Include="Microsoft.Extensions.DependencyModel" />
     <LatestPackageReference Include="Microsoft.Extensions.DiagnosticAdapter" />
+    <LatestPackageReference Include="Microsoft.Extensions.Diagnostics.Abstractions" />
+    <LatestPackageReference Include="Microsoft.Extensions.Diagnostics" />
     <LatestPackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" />
     <LatestPackageReference Include="Microsoft.Extensions.FileProviders.Composite" />
     <LatestPackageReference Include="Microsoft.Extensions.FileProviders.Physical" />

+ 2 - 0
eng/SharedFramework.External.props

@@ -21,6 +21,8 @@
     <ExternalAspNetCoreAppReference Include="Microsoft.Extensions.Configuration"                           Version="$(MicrosoftExtensionsConfigurationVersion)" />
     <ExternalAspNetCoreAppReference Include="Microsoft.Extensions.DependencyInjection.Abstractions"        Version="$(MicrosoftExtensionsDependencyInjectionAbstractionsVersion)" />
     <ExternalAspNetCoreAppReference Include="Microsoft.Extensions.DependencyInjection"                     Version="$(MicrosoftExtensionsDependencyInjectionVersion)" />
+    <ExternalAspNetCoreAppReference Include="Microsoft.Extensions.Diagnostics.Abstractions"                Version="$(MicrosoftExtensionsDiagnosticsVersion)" />
+    <ExternalAspNetCoreAppReference Include="Microsoft.Extensions.Diagnostics"                             Version="$(MicrosoftExtensionsDiagnosticsVersion)" />
     <ExternalAspNetCoreAppReference Include="Microsoft.Extensions.FileProviders.Abstractions"              Version="$(MicrosoftExtensionsFileProvidersAbstractionsVersion)" />
     <ExternalAspNetCoreAppReference Include="Microsoft.Extensions.FileProviders.Composite"                 Version="$(MicrosoftExtensionsFileProvidersCompositeVersion)" />
     <ExternalAspNetCoreAppReference Include="Microsoft.Extensions.FileProviders.Physical"                  Version="$(MicrosoftExtensionsFileProvidersPhysicalVersion)" />

+ 142 - 134
eng/Version.Details.xml

@@ -41,280 +41,288 @@
       <Uri>https://github.com/dotnet/efcore</Uri>
       <Sha>d3362f65007769fd1c8ef442743832d91c7a34cb</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Caching.Memory" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Caching.Memory" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.Binder" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.Binder" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.Json" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.Json" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration.Xml" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration.Xml" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Configuration" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Configuration" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.DependencyInjection" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.DependencyInjection" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.FileProviders.Abstractions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Diagnostics.Abstractions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.FileProviders.Composite" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Diagnostics" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.FileProviders.Abstractions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.FileProviders.Composite" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Hosting" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Http" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Hosting" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Logging.Configuration" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Http" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Logging.Console" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Logging.Debug" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Logging.Configuration" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Logging.EventSource" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Logging.Console" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Logging.EventLog" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Logging.Debug" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Logging.TraceSource" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Logging.EventSource" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Logging" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Logging.EventLog" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Logging.TraceSource" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Logging" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Options" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.Primitives" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.Options" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
+    </Dependency>
+    <Dependency Name="Microsoft.Extensions.Primitives" Version="8.0.0-preview.5.23274.13">
+      <Uri>https://github.com/dotnet/runtime</Uri>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
+    </Dependency>
+    <Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="8.0.0-preview.5.23274.13">
+      <Uri>https://github.com/dotnet/runtime</Uri>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
     <Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23268.1">
       <Uri>https://github.com/dotnet/source-build-externals</Uri>
       <Sha>21d564f9e16f7986d8af0692258afb91a52dda80</Sha>
       <SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
     </Dependency>
-    <Dependency Name="System.Configuration.ConfigurationManager" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Configuration.ConfigurationManager" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Diagnostics.DiagnosticSource" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Diagnostics.DiagnosticSource" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Diagnostics.EventLog" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Diagnostics.EventLog" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.DirectoryServices.Protocols" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.DirectoryServices.Protocols" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.IO.Pipelines" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.IO.Pipelines" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Net.Http.Json" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Net.Http.Json" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Net.Http.WinHttpHandler" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Net.Http.WinHttpHandler" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Reflection.Metadata" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Reflection.Metadata" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Resources.Extensions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Resources.Extensions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Security.Cryptography.Pkcs" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Security.Cryptography.Pkcs" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Security.Cryptography.Xml" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Security.Cryptography.Xml" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Security.Permissions" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Security.Permissions" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.ServiceProcess.ServiceController" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.ServiceProcess.ServiceController" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Text.Encodings.Web" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Text.Encodings.Web" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Text.Json" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Text.Json" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Threading.AccessControl" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Threading.AccessControl" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Threading.Channels" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Threading.Channels" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Threading.RateLimiting" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Threading.RateLimiting" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Extensions.DependencyModel" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Extensions.DependencyModel" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
     <!-- Transitive package to provide coherency in dotnet/extensions -->
-    <Dependency Name="Microsoft.Bcl.TimeProvider" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.Bcl.TimeProvider" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Collections.Immutable" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Collections.Immutable" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Diagnostics.PerformanceCounter" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Diagnostics.PerformanceCounter" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.IO.Hashing" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.IO.Hashing" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="System.Runtime.Caching" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="System.Runtime.Caching" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
     <!--
          Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
          All Runtime.$rid packages should have the same version.
     -->
-    <Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
       <SourceBuild RepoName="runtime" ManagedOnly="false" />
     </Dependency>
-    <Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
     <Dependency Name="Microsoft.Web.Xdt" Version="7.0.0-preview.22423.2">
       <Uri>https://github.com/dotnet/xdt</Uri>
@@ -347,9 +355,9 @@
   </ProductDependencies>
   <ToolsetDependencies>
     <!-- Listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
-    <Dependency Name="Microsoft.NETCore.Platforms" Version="8.0.0-preview.5.23273.1">
+    <Dependency Name="Microsoft.NETCore.Platforms" Version="8.0.0-preview.5.23274.13">
       <Uri>https://github.com/dotnet/runtime</Uri>
-      <Sha>1e421670a6456d9c5b924b7ffea14cab8559a2e9</Sha>
+      <Sha>7cf329b773fa5ed544a9377587018713751c73e3</Sha>
     </Dependency>
     <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.23262.5">
       <Uri>https://github.com/dotnet/arcade</Uri>

+ 69 - 67
eng/Versions.props

@@ -63,75 +63,77 @@
   -->
   <PropertyGroup Label="Automated">
     <!-- Packages from dotnet/runtime -->
-    <MicrosoftExtensionsDependencyModelVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsDependencyModelVersion>
-    <MicrosoftNETCoreAppRefVersion>8.0.0-preview.5.23273.1</MicrosoftNETCoreAppRefVersion>
-    <MicrosoftNETCoreAppRuntimewinx64Version>8.0.0-preview.5.23273.1</MicrosoftNETCoreAppRuntimewinx64Version>
-    <MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>8.0.0-preview.5.23273.1</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
-    <MicrosoftNETRuntimeWebAssemblySdkVersion>8.0.0-preview.5.23273.1</MicrosoftNETRuntimeWebAssemblySdkVersion>
-    <MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>8.0.0-preview.5.23273.1</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
-    <MicrosoftNETCoreBrowserDebugHostTransportVersion>8.0.0-preview.5.23273.1</MicrosoftNETCoreBrowserDebugHostTransportVersion>
-    <MicrosoftExtensionsCachingAbstractionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsCachingAbstractionsVersion>
-    <MicrosoftExtensionsCachingMemoryVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsCachingMemoryVersion>
-    <MicrosoftExtensionsConfigurationAbstractionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationAbstractionsVersion>
-    <MicrosoftExtensionsConfigurationBinderVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationBinderVersion>
-    <MicrosoftExtensionsConfigurationCommandLineVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationCommandLineVersion>
-    <MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
-    <MicrosoftExtensionsConfigurationFileExtensionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationFileExtensionsVersion>
-    <MicrosoftExtensionsConfigurationIniVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationIniVersion>
-    <MicrosoftExtensionsConfigurationJsonVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationJsonVersion>
-    <MicrosoftExtensionsConfigurationVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationVersion>
-    <MicrosoftExtensionsConfigurationUserSecretsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationUserSecretsVersion>
-    <MicrosoftExtensionsConfigurationXmlVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsConfigurationXmlVersion>
-    <MicrosoftExtensionsDependencyInjectionAbstractionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsDependencyInjectionAbstractionsVersion>
-    <MicrosoftExtensionsDependencyInjectionVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsDependencyInjectionVersion>
-    <MicrosoftExtensionsFileProvidersAbstractionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsFileProvidersAbstractionsVersion>
-    <MicrosoftExtensionsFileProvidersCompositeVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsFileProvidersCompositeVersion>
-    <MicrosoftExtensionsFileProvidersPhysicalVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsFileProvidersPhysicalVersion>
-    <MicrosoftExtensionsFileSystemGlobbingVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsFileSystemGlobbingVersion>
-    <MicrosoftExtensionsHostFactoryResolverSourcesVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsHostFactoryResolverSourcesVersion>
-    <MicrosoftExtensionsHostingAbstractionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsHostingAbstractionsVersion>
-    <MicrosoftExtensionsHostingVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsHostingVersion>
-    <MicrosoftExtensionsHttpVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsHttpVersion>
-    <MicrosoftExtensionsLoggingAbstractionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsLoggingAbstractionsVersion>
-    <MicrosoftExtensionsLoggingConfigurationVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsLoggingConfigurationVersion>
-    <MicrosoftExtensionsLoggingConsoleVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsLoggingConsoleVersion>
-    <MicrosoftExtensionsLoggingDebugVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsLoggingDebugVersion>
-    <MicrosoftExtensionsLoggingEventSourceVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsLoggingEventSourceVersion>
-    <MicrosoftExtensionsLoggingEventLogVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsLoggingEventLogVersion>
-    <MicrosoftExtensionsLoggingVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsLoggingVersion>
-    <MicrosoftExtensionsLoggingTraceSourceVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsLoggingTraceSourceVersion>
-    <MicrosoftExtensionsOptionsConfigurationExtensionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsOptionsConfigurationExtensionsVersion>
-    <MicrosoftExtensionsOptionsDataAnnotationsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsOptionsDataAnnotationsVersion>
-    <MicrosoftExtensionsOptionsVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsOptionsVersion>
-    <MicrosoftExtensionsPrimitivesVersion>8.0.0-preview.5.23273.1</MicrosoftExtensionsPrimitivesVersion>
-    <MicrosoftInternalRuntimeAspNetCoreTransportVersion>8.0.0-preview.5.23273.1</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
-    <SystemConfigurationConfigurationManagerVersion>8.0.0-preview.5.23273.1</SystemConfigurationConfigurationManagerVersion>
-    <SystemDiagnosticsDiagnosticSourceVersion>8.0.0-preview.5.23273.1</SystemDiagnosticsDiagnosticSourceVersion>
-    <SystemDiagnosticsEventLogVersion>8.0.0-preview.5.23273.1</SystemDiagnosticsEventLogVersion>
-    <SystemDirectoryServicesProtocolsVersion>8.0.0-preview.5.23273.1</SystemDirectoryServicesProtocolsVersion>
-    <SystemIOPipelinesVersion>8.0.0-preview.5.23273.1</SystemIOPipelinesVersion>
-    <SystemNetHttpJsonVersion>8.0.0-preview.5.23273.1</SystemNetHttpJsonVersion>
-    <SystemNetHttpWinHttpHandlerVersion>8.0.0-preview.5.23273.1</SystemNetHttpWinHttpHandlerVersion>
-    <SystemReflectionMetadataVersion>8.0.0-preview.5.23273.1</SystemReflectionMetadataVersion>
-    <SystemResourcesExtensionsVersion>8.0.0-preview.5.23273.1</SystemResourcesExtensionsVersion>
-    <SystemSecurityCryptographyPkcsVersion>8.0.0-preview.5.23273.1</SystemSecurityCryptographyPkcsVersion>
-    <SystemSecurityCryptographyXmlVersion>8.0.0-preview.5.23273.1</SystemSecurityCryptographyXmlVersion>
-    <SystemSecurityPermissionsVersion>8.0.0-preview.5.23273.1</SystemSecurityPermissionsVersion>
-    <SystemServiceProcessServiceControllerVersion>8.0.0-preview.5.23273.1</SystemServiceProcessServiceControllerVersion>
-    <SystemTextEncodingsWebVersion>8.0.0-preview.5.23273.1</SystemTextEncodingsWebVersion>
-    <SystemTextJsonVersion>8.0.0-preview.5.23273.1</SystemTextJsonVersion>
-    <SystemThreadingAccessControlVersion>8.0.0-preview.5.23273.1</SystemThreadingAccessControlVersion>
-    <SystemThreadingChannelsVersion>8.0.0-preview.5.23273.1</SystemThreadingChannelsVersion>
-    <SystemThreadingRateLimitingVersion>8.0.0-preview.5.23273.1</SystemThreadingRateLimitingVersion>
+    <MicrosoftExtensionsDependencyModelVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsDependencyModelVersion>
+    <MicrosoftNETCoreAppRefVersion>8.0.0-preview.5.23274.13</MicrosoftNETCoreAppRefVersion>
+    <MicrosoftNETCoreAppRuntimewinx64Version>8.0.0-preview.5.23274.13</MicrosoftNETCoreAppRuntimewinx64Version>
+    <MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>8.0.0-preview.5.23274.13</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
+    <MicrosoftNETRuntimeWebAssemblySdkVersion>8.0.0-preview.5.23274.13</MicrosoftNETRuntimeWebAssemblySdkVersion>
+    <MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>8.0.0-preview.5.23274.13</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
+    <MicrosoftNETCoreBrowserDebugHostTransportVersion>8.0.0-preview.5.23274.13</MicrosoftNETCoreBrowserDebugHostTransportVersion>
+    <MicrosoftExtensionsCachingAbstractionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsCachingAbstractionsVersion>
+    <MicrosoftExtensionsCachingMemoryVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsCachingMemoryVersion>
+    <MicrosoftExtensionsConfigurationAbstractionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationAbstractionsVersion>
+    <MicrosoftExtensionsConfigurationBinderVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationBinderVersion>
+    <MicrosoftExtensionsConfigurationCommandLineVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationCommandLineVersion>
+    <MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
+    <MicrosoftExtensionsConfigurationFileExtensionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationFileExtensionsVersion>
+    <MicrosoftExtensionsConfigurationIniVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationIniVersion>
+    <MicrosoftExtensionsConfigurationJsonVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationJsonVersion>
+    <MicrosoftExtensionsConfigurationVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationVersion>
+    <MicrosoftExtensionsConfigurationUserSecretsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationUserSecretsVersion>
+    <MicrosoftExtensionsConfigurationXmlVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsConfigurationXmlVersion>
+    <MicrosoftExtensionsDependencyInjectionAbstractionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsDependencyInjectionAbstractionsVersion>
+    <MicrosoftExtensionsDependencyInjectionVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsDependencyInjectionVersion>
+    <MicrosoftExtensionsDiagnosticsAbstractionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsDiagnosticsAbstractionsVersion>
+    <MicrosoftExtensionsDiagnosticsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsDiagnosticsVersion>
+    <MicrosoftExtensionsFileProvidersAbstractionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsFileProvidersAbstractionsVersion>
+    <MicrosoftExtensionsFileProvidersCompositeVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsFileProvidersCompositeVersion>
+    <MicrosoftExtensionsFileProvidersPhysicalVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsFileProvidersPhysicalVersion>
+    <MicrosoftExtensionsFileSystemGlobbingVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsFileSystemGlobbingVersion>
+    <MicrosoftExtensionsHostFactoryResolverSourcesVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsHostFactoryResolverSourcesVersion>
+    <MicrosoftExtensionsHostingAbstractionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsHostingAbstractionsVersion>
+    <MicrosoftExtensionsHostingVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsHostingVersion>
+    <MicrosoftExtensionsHttpVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsHttpVersion>
+    <MicrosoftExtensionsLoggingAbstractionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsLoggingAbstractionsVersion>
+    <MicrosoftExtensionsLoggingConfigurationVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsLoggingConfigurationVersion>
+    <MicrosoftExtensionsLoggingConsoleVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsLoggingConsoleVersion>
+    <MicrosoftExtensionsLoggingDebugVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsLoggingDebugVersion>
+    <MicrosoftExtensionsLoggingEventSourceVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsLoggingEventSourceVersion>
+    <MicrosoftExtensionsLoggingEventLogVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsLoggingEventLogVersion>
+    <MicrosoftExtensionsLoggingVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsLoggingVersion>
+    <MicrosoftExtensionsLoggingTraceSourceVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsLoggingTraceSourceVersion>
+    <MicrosoftExtensionsOptionsConfigurationExtensionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsOptionsConfigurationExtensionsVersion>
+    <MicrosoftExtensionsOptionsDataAnnotationsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsOptionsDataAnnotationsVersion>
+    <MicrosoftExtensionsOptionsVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsOptionsVersion>
+    <MicrosoftExtensionsPrimitivesVersion>8.0.0-preview.5.23274.13</MicrosoftExtensionsPrimitivesVersion>
+    <MicrosoftInternalRuntimeAspNetCoreTransportVersion>8.0.0-preview.5.23274.13</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
+    <SystemConfigurationConfigurationManagerVersion>8.0.0-preview.5.23274.13</SystemConfigurationConfigurationManagerVersion>
+    <SystemDiagnosticsDiagnosticSourceVersion>8.0.0-preview.5.23274.13</SystemDiagnosticsDiagnosticSourceVersion>
+    <SystemDiagnosticsEventLogVersion>8.0.0-preview.5.23274.13</SystemDiagnosticsEventLogVersion>
+    <SystemDirectoryServicesProtocolsVersion>8.0.0-preview.5.23274.13</SystemDirectoryServicesProtocolsVersion>
+    <SystemIOPipelinesVersion>8.0.0-preview.5.23274.13</SystemIOPipelinesVersion>
+    <SystemNetHttpJsonVersion>8.0.0-preview.5.23274.13</SystemNetHttpJsonVersion>
+    <SystemNetHttpWinHttpHandlerVersion>8.0.0-preview.5.23274.13</SystemNetHttpWinHttpHandlerVersion>
+    <SystemReflectionMetadataVersion>8.0.0-preview.5.23274.13</SystemReflectionMetadataVersion>
+    <SystemResourcesExtensionsVersion>8.0.0-preview.5.23274.13</SystemResourcesExtensionsVersion>
+    <SystemSecurityCryptographyPkcsVersion>8.0.0-preview.5.23274.13</SystemSecurityCryptographyPkcsVersion>
+    <SystemSecurityCryptographyXmlVersion>8.0.0-preview.5.23274.13</SystemSecurityCryptographyXmlVersion>
+    <SystemSecurityPermissionsVersion>8.0.0-preview.5.23274.13</SystemSecurityPermissionsVersion>
+    <SystemServiceProcessServiceControllerVersion>8.0.0-preview.5.23274.13</SystemServiceProcessServiceControllerVersion>
+    <SystemTextEncodingsWebVersion>8.0.0-preview.5.23274.13</SystemTextEncodingsWebVersion>
+    <SystemTextJsonVersion>8.0.0-preview.5.23274.13</SystemTextJsonVersion>
+    <SystemThreadingAccessControlVersion>8.0.0-preview.5.23274.13</SystemThreadingAccessControlVersion>
+    <SystemThreadingChannelsVersion>8.0.0-preview.5.23274.13</SystemThreadingChannelsVersion>
+    <SystemThreadingRateLimitingVersion>8.0.0-preview.5.23274.13</SystemThreadingRateLimitingVersion>
     <!-- Only listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
-    <MicrosoftNETCorePlatformsVersion>8.0.0-preview.5.23273.1</MicrosoftNETCorePlatformsVersion>
-    <MicrosoftBclAsyncInterfacesVersion>8.0.0-preview.5.23273.1</MicrosoftBclAsyncInterfacesVersion>
+    <MicrosoftNETCorePlatformsVersion>8.0.0-preview.5.23274.13</MicrosoftNETCorePlatformsVersion>
+    <MicrosoftBclAsyncInterfacesVersion>8.0.0-preview.5.23274.13</MicrosoftBclAsyncInterfacesVersion>
     <!-- Transitive package to provide coherency in dotnet/extensions -->
-    <MicrosoftBclTimeProviderVersion>8.0.0-preview.5.23273.1</MicrosoftBclTimeProviderVersion>
-    <SystemCollectionsImmutableVersion>8.0.0-preview.5.23273.1</SystemCollectionsImmutableVersion>
-    <SystemDiagnosticsPerformanceCounterVersion>8.0.0-preview.5.23273.1</SystemDiagnosticsPerformanceCounterVersion>
-    <SystemIOHashingVersion>8.0.0-preview.5.23273.1</SystemIOHashingVersion>
-    <SystemRuntimeCachingVersion>8.0.0-preview.5.23273.1</SystemRuntimeCachingVersion>
+    <MicrosoftBclTimeProviderVersion>8.0.0-preview.5.23274.13</MicrosoftBclTimeProviderVersion>
+    <SystemCollectionsImmutableVersion>8.0.0-preview.5.23274.13</SystemCollectionsImmutableVersion>
+    <SystemDiagnosticsPerformanceCounterVersion>8.0.0-preview.5.23274.13</SystemDiagnosticsPerformanceCounterVersion>
+    <SystemIOHashingVersion>8.0.0-preview.5.23274.13</SystemIOHashingVersion>
+    <SystemRuntimeCachingVersion>8.0.0-preview.5.23274.13</SystemRuntimeCachingVersion>
     <!-- Packages from dotnet/efcore -->
     <dotnetefVersion>8.0.0-preview.6.23273.4</dotnetefVersion>
     <MicrosoftEntityFrameworkCoreInMemoryVersion>8.0.0-preview.6.23273.4</MicrosoftEntityFrameworkCoreInMemoryVersion>

+ 4 - 0
src/Framework/test/TestData.cs

@@ -119,6 +119,8 @@ public static class TestData
                 "Microsoft.Extensions.Configuration.Xml",
                 "Microsoft.Extensions.DependencyInjection",
                 "Microsoft.Extensions.DependencyInjection.Abstractions",
+                "Microsoft.Extensions.Diagnostics",
+                "Microsoft.Extensions.Diagnostics.Abstractions",
                 "Microsoft.Extensions.Diagnostics.HealthChecks",
                 "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions",
                 "Microsoft.Extensions.FileProviders.Abstractions",
@@ -268,6 +270,8 @@ public static class TestData
                 { "Microsoft.Extensions.Configuration" },
                 { "Microsoft.Extensions.DependencyInjection.Abstractions" },
                 { "Microsoft.Extensions.DependencyInjection" },
+                { "Microsoft.Extensions.Diagnostics.Abstractions" },
+                { "Microsoft.Extensions.Diagnostics" },
                 { "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" },
                 { "Microsoft.Extensions.Diagnostics.HealthChecks" },
                 { "Microsoft.Extensions.Features" },

+ 1 - 0
src/Hosting/Hosting/src/GenericHost/GenericWebHostBuilder.cs

@@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection.Extensions;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Hosting;
 
 namespace Microsoft.AspNetCore.Hosting;

+ 1 - 0
src/Hosting/Hosting/src/GenericHost/SlimWebHostBuilder.cs

@@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection.Extensions;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Hosting;
 
 namespace Microsoft.AspNetCore.Hosting;

+ 2 - 2
src/Hosting/Hosting/src/Internal/HostingMetrics.cs

@@ -5,7 +5,7 @@ using System.Collections.Frozen;
 using System.Diagnostics;
 using System.Diagnostics.Metrics;
 using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.Metrics;
+using Microsoft.Extensions.Diagnostics.Metrics;
 
 namespace Microsoft.AspNetCore.Hosting;
 
@@ -19,7 +19,7 @@ internal sealed class HostingMetrics : IDisposable
 
     public HostingMetrics(IMeterFactory meterFactory)
     {
-        _meter = meterFactory.CreateMeter(MeterName);
+        _meter = meterFactory.Create(MeterName);
 
         _currentRequestsCounter = _meter.CreateUpDownCounter<long>(
             "current-requests",

+ 1 - 0
src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj

@@ -25,6 +25,7 @@
     <Reference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
     <Reference Include="Microsoft.Extensions.Configuration.FileExtensions" />
     <Reference Include="Microsoft.Extensions.Configuration" />
+    <Reference Include="Microsoft.Extensions.Diagnostics" />
     <Reference Include="Microsoft.Extensions.DependencyInjection" />
     <Reference Include="Microsoft.Extensions.FileProviders.Physical" />
     <Reference Include="Microsoft.Extensions.FileProviders.Composite" />

+ 1 - 0
src/Hosting/Hosting/src/WebHostBuilder.cs

@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection.Extensions;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
 

+ 7 - 7
src/Hosting/Hosting/test/HostingApplicationDiagnosticsTests.cs

@@ -2,13 +2,15 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Diagnostics;
+using System.Diagnostics.Metrics;
 using System.Diagnostics.Tracing;
 using System.Reflection;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Features;
 using Microsoft.AspNetCore.Internal;
+using Microsoft.AspNetCore.Testing;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Metrics;
 using Moq;
 
 namespace Microsoft.AspNetCore.Hosting.Tests;
@@ -44,17 +46,15 @@ public class HostingApplicationDiagnosticsTests
             });
 
         var testMeterFactory1 = new TestMeterFactory();
-        var testMeterRegister1 = new TestMeterRegistry(testMeterFactory1.Meters);
         var testMeterFactory2 = new TestMeterFactory();
-        var testMeterRegister2 = new TestMeterRegistry(testMeterFactory2.Meters);
 
         var hostingApplication1 = CreateApplication(out var features1, eventSource: hostingEventSource, meterFactory: testMeterFactory1);
         var hostingApplication2 = CreateApplication(out var features2, eventSource: hostingEventSource, meterFactory: testMeterFactory2);
 
-        using var currentRequestsRecorder1 = new InstrumentRecorder<long>(testMeterRegister1, HostingMetrics.MeterName, "current-requests");
-        using var currentRequestsRecorder2 = new InstrumentRecorder<long>(testMeterRegister2, HostingMetrics.MeterName, "current-requests");
-        using var requestDurationRecorder1 = new InstrumentRecorder<double>(testMeterRegister1, HostingMetrics.MeterName, "request-duration");
-        using var requestDurationRecorder2 = new InstrumentRecorder<double>(testMeterRegister2, HostingMetrics.MeterName, "request-duration");
+        using var currentRequestsRecorder1 = new InstrumentRecorder<long>(testMeterFactory1, HostingMetrics.MeterName, "current-requests");
+        using var currentRequestsRecorder2 = new InstrumentRecorder<long>(testMeterFactory2, HostingMetrics.MeterName, "current-requests");
+        using var requestDurationRecorder1 = new InstrumentRecorder<double>(testMeterFactory1, HostingMetrics.MeterName, "request-duration");
+        using var requestDurationRecorder2 = new InstrumentRecorder<double>(testMeterFactory2, HostingMetrics.MeterName, "request-duration");
 
         // Act/Assert 1
         var context1 = hostingApplication1.CreateContext(features1);

+ 1 - 4
src/Hosting/Hosting/test/HostingApplicationTests.cs

@@ -2,17 +2,14 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Collections;
-using System.Collections.ObjectModel;
 using System.Diagnostics;
-using System.Diagnostics.Metrics;
-using Microsoft.AspNetCore.Hosting.Fakes;
 using Microsoft.AspNetCore.Hosting.Server.Abstractions;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Features;
 using Microsoft.AspNetCore.Testing;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Logging.Abstractions;
-using Microsoft.Extensions.Metrics;
 using Moq;
 using static Microsoft.AspNetCore.Hosting.HostingApplication;
 

+ 7 - 10
src/Hosting/Hosting/test/HostingMetricsTests.cs

@@ -9,8 +9,8 @@ using Microsoft.AspNetCore.Http.Features;
 using Microsoft.AspNetCore.Internal;
 using Microsoft.AspNetCore.Testing;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Logging.Abstractions;
-using Microsoft.Extensions.Metrics;
 
 namespace Microsoft.AspNetCore.Hosting.Tests;
 
@@ -21,13 +21,12 @@ public class HostingMetricsTests
     {
         // Arrange
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
         var hostingApplication = CreateApplication(meterFactory: meterFactory);
         var httpContext = new DefaultHttpContext();
         var meter = meterFactory.Meters.Single();
 
-        using var requestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, HostingMetrics.MeterName, "request-duration");
-        using var currentRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, HostingMetrics.MeterName, "current-requests");
+        using var requestDurationRecorder = new InstrumentRecorder<double>(meterFactory, HostingMetrics.MeterName, "request-duration");
+        using var currentRequestsRecorder = new InstrumentRecorder<long>(meterFactory, HostingMetrics.MeterName, "current-requests");
 
         // Act/Assert
         Assert.Equal(HostingMetrics.MeterName, meter.Name);
@@ -111,7 +110,6 @@ public class HostingMetricsTests
         // Arrange
         var syncPoint = new SyncPoint();
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
         var hostingApplication = CreateApplication(meterFactory: meterFactory, requestDelegate: async ctx =>
         {
             await syncPoint.WaitToContinue();
@@ -130,8 +128,8 @@ public class HostingMetricsTests
 
         await syncPoint.WaitForSyncPoint().DefaultTimeout();
 
-        using var requestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, HostingMetrics.MeterName, "request-duration");
-        using var currentRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, HostingMetrics.MeterName, "current-requests");
+        using var requestDurationRecorder = new InstrumentRecorder<double>(meterFactory, HostingMetrics.MeterName, "request-duration");
+        using var currentRequestsRecorder = new InstrumentRecorder<long>(meterFactory, HostingMetrics.MeterName, "current-requests");
         context1.HttpContext.Response.StatusCode = StatusCodes.Status200OK;
 
         syncPoint.Continue();
@@ -148,13 +146,12 @@ public class HostingMetricsTests
     {
         // Arrange
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
         var hostingApplication = CreateApplication(meterFactory: meterFactory);
         var httpContext = new DefaultHttpContext();
         var meter = meterFactory.Meters.Single();
 
-        using var requestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, HostingMetrics.MeterName, "request-duration");
-        using var currentRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, HostingMetrics.MeterName, "current-requests");
+        using var requestDurationRecorder = new InstrumentRecorder<double>(meterFactory, HostingMetrics.MeterName, "request-duration");
+        using var currentRequestsRecorder = new InstrumentRecorder<long>(meterFactory, HostingMetrics.MeterName, "current-requests");
 
         // Act/Assert
         Assert.Equal(HostingMetrics.MeterName, meter.Name);

+ 1 - 0
src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj

@@ -8,6 +8,7 @@
     <Compile Include="$(SharedSourceRoot)EventSource.Testing\TestEventListener.cs" />
     <Compile Include="$(SharedSourceRoot)EventSource.Testing\TestCounterListener.cs" />
     <Compile Include="$(SharedSourceRoot)SyncPoint\SyncPoint.cs" />
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
     <Content Include="testroot\**\*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
     <Content Include="Microsoft.AspNetCore.Hosting.StaticWebAssets.xml" CopyToOutputDirectory="PreserveNewest" />
   </ItemGroup>

+ 0 - 23
src/Http/Http.Abstractions/src/Microsoft.AspNetCore.Http.Abstractions.csproj

@@ -54,29 +54,6 @@ Microsoft.AspNetCore.Http.HttpResponse</Description>
     </Compile>
   </ItemGroup>
 
-  <!-- Temporary hack to make prototype Metrics DI integration types available -->
-  <!-- TODO: Remove when Metrics DI intergration package is available https://github.com/dotnet/aspnetcore/issues/47618 -->
-  <ItemGroup>
-    <Compile Include="$(SharedSourceRoot)Metrics\**\*.cs" LinkBase="Metrics" />
-  </ItemGroup>
-  <ItemGroup>
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Hosting" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Hosting.Tests" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Server.Kestrel.Core" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Server.Kestrel.Core.Tests" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Server.Kestrel.Tests" />
-    <InternalsVisibleTo Include="InMemory.FunctionalTests" />
-    <InternalsVisibleTo Include="Sockets.BindTests" />
-    <InternalsVisibleTo Include="Sockets.FunctionalTests" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Http.Connections" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Http.Connections.Tests" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.Diagnostics.Tests" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.RateLimiting" />
-    <InternalsVisibleTo Include="Microsoft.AspNetCore.RateLimiting.Tests" />
-  </ItemGroup>
-
   <ItemGroup>
     <InternalsVisibleTo Include="Microsoft.AspNetCore.Http.Abstractions.Tests" />
   </ItemGroup>

+ 5 - 4
src/Middleware/Diagnostics/test/UnitTests/DeveloperExceptionPageMiddlewareTest.cs

@@ -2,6 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Diagnostics;
+using System.Diagnostics.Metrics;
 using System.Net;
 using System.Net.Http;
 using System.Net.Http.Headers;
@@ -14,8 +15,8 @@ using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.TestHost;
 using Microsoft.AspNetCore.Testing;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Metrics;
 
 namespace Microsoft.AspNetCore.Diagnostics;
 
@@ -540,9 +541,9 @@ public class DeveloperExceptionPageMiddlewareTest : LoggedTest
         var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
 
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
-        var instrumentRecorder = new InstrumentRecorder<double>(meterRegistry, "Microsoft.AspNetCore.Hosting", "request-duration");
-        instrumentRecorder.Register(m =>
+        using var instrumentRecorder = new InstrumentRecorder<double>(meterFactory, "Microsoft.AspNetCore.Hosting", "request-duration");
+        using var measurementReporter = new MeasurementReporter<double>(meterFactory, "Microsoft.AspNetCore.Hosting", "request-duration");
+        measurementReporter.Register(m =>
         {
             tcs.SetResult();
         });

+ 5 - 4
src/Middleware/Diagnostics/test/UnitTests/ExceptionHandlerTest.cs

@@ -2,6 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Diagnostics;
+using System.Diagnostics.Metrics;
 using System.Net;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
@@ -9,10 +10,10 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.TestHost;
 using Microsoft.AspNetCore.Testing;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging.Testing;
-using Microsoft.Extensions.Metrics;
 
 namespace Microsoft.AspNetCore.Diagnostics;
 
@@ -917,9 +918,9 @@ public class ExceptionHandlerTest
         var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
 
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
-        var instrumentRecorder = new InstrumentRecorder<double>(meterRegistry, "Microsoft.AspNetCore.Hosting", "request-duration");
-        instrumentRecorder.Register(m =>
+        using var instrumentRecorder = new InstrumentRecorder<double>(meterFactory, "Microsoft.AspNetCore.Hosting", "request-duration");
+        using var measurementReporter = new MeasurementReporter<double>(meterFactory, "Microsoft.AspNetCore.Hosting", "request-duration");
+        measurementReporter.Register(m =>
         {
             tcs.SetResult();
         });

+ 2 - 0
src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj

@@ -11,6 +11,8 @@
 
   <ItemGroup>
     <ProjectReference Include="..\testassets\ClassLibraryWithPortablePdbs\ClassLibraryWithPortablePdbs.csproj" />
+
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
   </ItemGroup>
 
   <ItemGroup>

+ 1 - 0
src/Middleware/RateLimiting/src/Microsoft.AspNetCore.RateLimiting.csproj

@@ -14,6 +14,7 @@
     <Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
     <Reference Include="Microsoft.Extensions.Logging.Abstractions" />
     <Reference Include="Microsoft.Extensions.Options" />
+    <Reference Include="Microsoft.Extensions.Diagnostics" />
     <Reference Include="System.Threading.RateLimiting" />
 
     <Compile Include="$(SharedSourceRoot)ValueStopwatch\*.cs" />

+ 1 - 0
src/Middleware/RateLimiting/src/RateLimiterServiceCollectionExtensions.cs

@@ -3,6 +3,7 @@
 
 using Microsoft.AspNetCore.RateLimiting;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Diagnostics.Metrics;
 
 namespace Microsoft.AspNetCore.Builder;
 

+ 2 - 2
src/Middleware/RateLimiting/src/RateLimitingMetrics.cs

@@ -4,7 +4,7 @@
 using System.Diagnostics;
 using System.Diagnostics.Metrics;
 using System.Runtime.CompilerServices;
-using Microsoft.Extensions.Metrics;
+using Microsoft.Extensions.Diagnostics.Metrics;
 
 namespace Microsoft.AspNetCore.RateLimiting;
 
@@ -21,7 +21,7 @@ internal sealed class RateLimitingMetrics : IDisposable
 
     public RateLimitingMetrics(IMeterFactory meterFactory)
     {
-        _meter = meterFactory.CreateMeter(MeterName);
+        _meter = meterFactory.Create(MeterName);
 
         _currentLeasedRequestsCounter = _meter.CreateUpDownCounter<long>(
             "current-leased-requests",

+ 2 - 1
src/Middleware/RateLimiting/test/Microsoft.AspNetCore.RateLimiting.Tests.csproj

@@ -9,6 +9,7 @@
     <Reference Include="Microsoft.AspNetCore.RateLimiting" />
     <Reference Include="Microsoft.AspNetCore.Routing" />
 
-    <Compile Include="$(SharedSourceRoot)SyncPoint\SyncPoint.cs" Link="Internal\SyncPoint.cs" />
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
+    <Compile Include="$(SharedSourceRoot)SyncPoint\SyncPoint.cs" LinkBase="shared" />
   </ItemGroup>
 </Project>

+ 26 - 31
src/Middleware/RateLimiting/test/RateLimitingMetricsTests.cs

@@ -10,9 +10,9 @@ using Microsoft.AspNetCore.Routing;
 using Microsoft.AspNetCore.Routing.Patterns;
 using Microsoft.AspNetCore.Testing;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging.Abstractions;
-using Microsoft.Extensions.Metrics;
 using Microsoft.Extensions.Options;
 using Moq;
 
@@ -25,7 +25,6 @@ public class RateLimitingMetricsTests
     {
         // Arrange
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
 
         var options = CreateOptionsAccessor();
         options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(false));
@@ -35,11 +34,11 @@ public class RateLimitingMetricsTests
 
         var context = new DefaultHttpContext();
 
-        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration");
-        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests");
-        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests");
-        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration");
-        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests");
+        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "leased-request-duration");
+        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-leased-requests");
+        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-queued-requests");
+        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "queued-request-duration");
+        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "lease-failed-requests");
 
         // Act
         await middleware.Invoke(context).DefaultTimeout();
@@ -66,7 +65,6 @@ public class RateLimitingMetricsTests
         var syncPoint = new SyncPoint();
 
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
 
         var options = CreateOptionsAccessor();
         options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(true));
@@ -83,11 +81,11 @@ public class RateLimitingMetricsTests
         var context = new DefaultHttpContext();
         context.Request.Method = "GET";
 
-        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration");
-        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests");
-        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests");
-        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration");
-        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests");
+        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "leased-request-duration");
+        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-leased-requests");
+        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-queued-requests");
+        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "queued-request-duration");
+        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "lease-failed-requests");
 
         // Act
         var middlewareTask = middleware.Invoke(context);
@@ -122,7 +120,6 @@ public class RateLimitingMetricsTests
         var syncPoint = new SyncPoint();
 
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
 
         var options = CreateOptionsAccessor();
         options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(true));
@@ -144,11 +141,11 @@ public class RateLimitingMetricsTests
 
         await syncPoint.WaitForSyncPoint().DefaultTimeout();
 
-        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration");
-        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests");
-        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests");
-        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration");
-        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests");
+        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "leased-request-duration");
+        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-leased-requests");
+        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-queued-requests");
+        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "queued-request-duration");
+        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "lease-failed-requests");
 
         syncPoint.Continue();
 
@@ -169,7 +166,6 @@ public class RateLimitingMetricsTests
         var syncPoint = new SyncPoint();
 
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
 
         var services = new ServiceCollection();
 
@@ -196,11 +192,11 @@ public class RateLimitingMetricsTests
         routeEndpointBuilder.Metadata.Add(new EnableRateLimitingAttribute("concurrencyPolicy"));
         var endpoint = routeEndpointBuilder.Build();
 
-        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration");
-        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests");
-        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests");
-        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration");
-        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests");
+        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "leased-request-duration");
+        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-leased-requests");
+        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-queued-requests");
+        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "queued-request-duration");
+        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "lease-failed-requests");
 
         // Act
         var context1 = new DefaultHttpContext();
@@ -241,7 +237,6 @@ public class RateLimitingMetricsTests
         var syncPoint = new SyncPoint();
 
         var meterFactory = new TestMeterFactory();
-        var meterRegistry = new TestMeterRegistry(meterFactory.Meters);
 
         var services = new ServiceCollection();
 
@@ -284,11 +279,11 @@ public class RateLimitingMetricsTests
 
         // Start listening while the second request is queued.
 
-        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "leased-request-duration");
-        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-leased-requests");
-        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "current-queued-requests");
-        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterRegistry, RateLimitingMetrics.MeterName, "queued-request-duration");
-        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterRegistry, RateLimitingMetrics.MeterName, "lease-failed-requests");
+        using var leaseRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "leased-request-duration");
+        using var currentLeaseRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-leased-requests");
+        using var currentRequestsQueuedRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "current-queued-requests");
+        using var queuedRequestDurationRecorder = new InstrumentRecorder<double>(meterFactory, RateLimitingMetrics.MeterName, "queued-request-duration");
+        using var leaseFailedRequestsRecorder = new InstrumentRecorder<long>(meterFactory, RateLimitingMetrics.MeterName, "lease-failed-requests");
 
         Assert.Empty(currentRequestsQueuedRecorder.GetMeasurements());
         Assert.Empty(queuedRequestDurationRecorder.GetMeasurements());

+ 0 - 1
src/Middleware/RateLimiting/test/RateLimitingMiddlewareTests.cs

@@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Testing;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging.Abstractions;
 using Microsoft.Extensions.Logging.Testing;
-using Microsoft.Extensions.Metrics;
 using Microsoft.Extensions.Options;
 using Moq;
 

+ 2 - 2
src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelMetrics.cs

@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using Microsoft.AspNetCore.Connections;
-using Microsoft.Extensions.Metrics;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using System.Diagnostics;
 using System.Diagnostics.Metrics;
 using System.Runtime.CompilerServices;
@@ -27,7 +27,7 @@ internal sealed class KestrelMetrics
 
     public KestrelMetrics(IMeterFactory meterFactory)
     {
-        _meter = meterFactory.CreateMeter(MeterName);
+        _meter = meterFactory.Create(MeterName);
 
         _currentConnectionsCounter = _meter.CreateUpDownCounter<long>(
            "current-connections",

+ 3 - 3
src/Servers/Kestrel/Core/src/KestrelServer.cs

@@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Https;
 using Microsoft.AspNetCore.Server.Kestrel.Https.Internal;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Metrics;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Options;
 
 namespace Microsoft.AspNetCore.Server.Kestrel.Core;
@@ -71,9 +71,9 @@ public class KestrelServer : IServer
     // This factory used when type is created without DI. For example, via KestrelServer.
     private sealed class DummyMeterFactory : IMeterFactory
     {
-        public Meter CreateMeter(string name) => new Meter(name);
+        public Meter Create(MeterOptions options) => new Meter(options);
 
-        public Meter CreateMeter(MeterOptions options) => new Meter(options.Name, options.Version);
+        public void Dispose() { }
     }
 
     private sealed class SimpleHttpsConfigurationService : IHttpsConfigurationService

+ 3 - 0
src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj

@@ -20,6 +20,8 @@
     <Compile Include="$(KestrelSharedSourceRoot)\HPackHeaderWriter.cs" Link="Internal\Http2\HPackHeaderWriter.cs" />
     <Compile Include="$(KestrelSharedSourceRoot)\Http2HeadersEnumerator.cs" Link="Internal\Http2\Http2HeadersEnumerator.cs" />
     <Compile Include="$(SharedSourceRoot)CertificateGeneration\**\*.cs" />
+    <Compile Include="$(SharedSourceRoot)ValueTaskExtensions\**\*.cs" />
+    <Compile Include="$(SharedSourceRoot)UrlDecoder\**\*.cs" />
     <Compile Include="$(SharedSourceRoot)InternalHeaderNames.cs" Link="Shared\InternalHeaderNames.cs"/>
     <Compile Include="$(SharedSourceRoot)Buffers\**\*.cs" LinkBase="Internal\Infrastructure\PipeWriterHelpers" />
     <Compile Include="$(SharedSourceRoot)runtime\*.cs" Link="Shared\runtime\%(Filename)%(Extension)" />
@@ -37,6 +39,7 @@
     <Reference Include="Microsoft.AspNetCore.Connections.Abstractions" />
     <Reference Include="Microsoft.AspNetCore.WebUtilities" />
     <Reference Include="Microsoft.Extensions.Configuration.Binder" />
+    <Reference Include="Microsoft.Extensions.Diagnostics" />
     <Reference Include="Microsoft.Extensions.Logging.Abstractions" />
     <Reference Include="Microsoft.Extensions.Options" />
     <Reference Include="Microsoft.Net.Http.Headers" />

+ 0 - 1
src/Servers/Kestrel/Core/test/KestrelServerTests.cs

@@ -16,7 +16,6 @@ using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Metrics;
 using Microsoft.Extensions.Options;
 using Microsoft.Extensions.Primitives;
 using Microsoft.Net.Http.Headers;

+ 1 - 0
src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj

@@ -9,6 +9,7 @@
   <ItemGroup>
     <Compile Include="$(SharedSourceRoot)NullScope.cs" />
     <Compile Include="$(SharedSourceRoot)Buffers.Testing\*.cs" />
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
     <Compile Include="$(KestrelSharedSourceRoot)test\*.cs" LinkBase="shared" />
     <Compile Include="$(SharedSourceRoot)test\MockTimeProvider.cs" LinkBase="shared" />
     <Compile Include="$(KestrelSharedSourceRoot)KnownHeaders.cs" LinkBase="shared" />

+ 0 - 1
src/Servers/Kestrel/Kestrel/test/KestrelConfigurationLoaderTests.cs

@@ -13,7 +13,6 @@ using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.FileProviders;
 using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Metrics;
 using Microsoft.Extensions.Primitives;
 using Moq;
 

+ 1 - 0
src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj

@@ -7,6 +7,7 @@
   <ItemGroup>
     <Compile Include="$(SharedSourceRoot)NullScope.cs" />
     <Compile Include="$(SharedSourceRoot)TestResources.cs" Link="shared\TestResources.cs" />
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
     <Content Include="$(SharedSourceRoot)TestCertificates\*.pfx" LinkBase="shared\TestCertificates" CopyToOutputDirectory="PreserveNewest" />
     <Content Include="$(SharedSourceRoot)TestCertificates\*.crt" LinkBase="shared\TestCertificates" CopyToOutputDirectory="PreserveNewest" />
     <Content Include="$(SharedSourceRoot)TestCertificates\*.key" LinkBase="shared\TestCertificates" CopyToOutputDirectory="PreserveNewest" />

+ 1 - 0
src/Servers/Kestrel/perf/Microbenchmarks/Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks.csproj

@@ -10,6 +10,7 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
     <Compile Include="$(KestrelSharedSourceRoot)test\DummyApplication.cs" />
     <Compile Include="$(SharedSourceRoot)test\MockTimeProvider.cs" />
     <Compile Include="$(KestrelSharedSourceRoot)test\Http3\Http3InMemory.cs" />

+ 0 - 1
src/Servers/Kestrel/shared/test/TestContextFactory.cs

@@ -15,7 +15,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3;
 using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging.Abstractions;
-using Microsoft.Extensions.Metrics;
 
 namespace Microsoft.AspNetCore.Testing;
 

+ 0 - 1
src/Servers/Kestrel/shared/test/TestServiceContext.cs

@@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
 using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging.Abstractions;
-using Microsoft.Extensions.Metrics;
 
 namespace Microsoft.AspNetCore.Testing;
 

+ 2 - 2
src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs

@@ -15,7 +15,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
 using Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests.TestTransport;
 using Microsoft.AspNetCore.Server.Kestrel.Tests;
 using Microsoft.AspNetCore.Testing;
-using Microsoft.Extensions.Metrics;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Xunit;
 
 namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests;
@@ -102,7 +102,7 @@ public class ConnectionLimitTests : LoggedTest
     public async Task RejectsConnectionsWhenLimitReached()
     {
         var testMeterFactory = new TestMeterFactory();
-        using var rejectedConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "rejected-connections");
+        using var rejectedConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "rejected-connections");
 
         const int max = 10;
         var requestTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);

+ 0 - 3
src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs

@@ -1,8 +1,6 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 
-using System.Globalization;
-using System.Net;
 using System.Net.Http;
 using System.Net.Security;
 using System.Security.Authentication;
@@ -24,7 +22,6 @@ using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging.Abstractions;
-using Microsoft.Extensions.Metrics;
 using Moq;
 
 namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests;

+ 0 - 7
src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsTests.cs

@@ -1,14 +1,10 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 
-using System;
-using System.Collections.Generic;
 using System.Net.Security;
 using System.Security.Authentication;
 using System.Security.Cryptography.X509Certificates;
 using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
 using Microsoft.AspNetCore.Connections;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
@@ -24,10 +20,7 @@ using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Internal;
 using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Metrics;
-using Microsoft.Extensions.Options;
 using Moq;
-using Xunit;
 
 namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests;
 

+ 1 - 0
src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj

@@ -10,6 +10,7 @@
   <ItemGroup>
     <Compile Include="$(SharedSourceRoot)NullScope.cs" />
     <Compile Include="$(SharedSourceRoot)SyncPoint\SyncPoint.cs" Link="SyncPoint.cs" />
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
     <Compile Include="$(KestrelSharedSourceRoot)test\*.cs" LinkBase="shared" />
     <Compile Include="$(SharedSourceRoot)test\MockTimeProvider.cs" LinkBase="shared" />
     <Compile Include="$(KestrelSharedSourceRoot)test\Http3\*.cs" LinkBase="shared" />

+ 22 - 22
src/Servers/Kestrel/test/InMemory.FunctionalTests/KestrelMetricsTests.cs

@@ -18,7 +18,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
 using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
 using Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests.TestTransport;
 using Microsoft.AspNetCore.Testing;
-using Microsoft.Extensions.Metrics;
+using Microsoft.Extensions.Diagnostics.Metrics;
 
 namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests;
 
@@ -46,9 +46,9 @@ public class KestrelMetricsTests : TestApplicationErrorLoggerLoggedTest
         });
 
         var testMeterFactory = new TestMeterFactory();
-        using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
-        using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
-        using var queuedConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
+        using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
+        using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
+        using var queuedConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
 
         var serviceContext = new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory));
 
@@ -122,9 +122,9 @@ public class KestrelMetricsTests : TestApplicationErrorLoggerLoggedTest
             // Wait for connection to start on the server.
             await sync.WaitForSyncPoint();
 
-            using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
-            using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
-            using var queuedConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
+            using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
+            using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
+            using var queuedConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
 
             // Signal that connection can continue.
             sync.Continue();
@@ -169,9 +169,9 @@ public class KestrelMetricsTests : TestApplicationErrorLoggerLoggedTest
         });
 
         var testMeterFactory = new TestMeterFactory();
-        using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
-        using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
-        using var queuedConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
+        using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
+        using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
+        using var queuedConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
 
         var serviceContext = new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory));
 
@@ -244,9 +244,9 @@ public class KestrelMetricsTests : TestApplicationErrorLoggerLoggedTest
         });
 
         var testMeterFactory = new TestMeterFactory();
-        using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
-        using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
-        using var queuedConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
+        using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
+        using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
+        using var queuedConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
 
         var serviceContext = new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory));
 
@@ -287,9 +287,9 @@ public class KestrelMetricsTests : TestApplicationErrorLoggerLoggedTest
         var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
 
         var testMeterFactory = new TestMeterFactory();
-        using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
-        using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
-        using var currentUpgradedRequests = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-upgraded-connections");
+        using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
+        using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
+        using var currentUpgradedRequests = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "current-upgraded-connections");
 
         var serviceContext = new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory));
 
@@ -331,12 +331,12 @@ public class KestrelMetricsTests : TestApplicationErrorLoggerLoggedTest
         var requestsReceived = 0;
 
         var testMeterFactory = new TestMeterFactory();
-        using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
-        using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
-        using var queuedConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
-        using var queuedRequests = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "queued-requests");
-        using var tlsHandshakeDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "tls-handshake-duration");
-        using var currentTlsHandshakes = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), "Microsoft.AspNetCore.Server.Kestrel", "current-tls-handshakes");
+        using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "connection-duration");
+        using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "current-connections");
+        using var queuedConnections = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "queued-connections");
+        using var queuedRequests = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "queued-requests");
+        using var tlsHandshakeDuration = new InstrumentRecorder<double>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "tls-handshake-duration");
+        using var currentTlsHandshakes = new InstrumentRecorder<long>(testMeterFactory, "Microsoft.AspNetCore.Server.Kestrel", "current-tls-handshakes");
 
         await using (var server = new TestServer(context =>
         {

+ 1 - 0
src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj

@@ -10,6 +10,7 @@
     <Compile Include="..\BindTests\**\*.cs" />
     <Compile Include="..\Sockets.FunctionalTests\TransportSelector.cs" />
     <Compile Include="$(SharedSourceRoot)NullScope.cs" />
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
     <Compile Include="$(KestrelSharedSourceRoot)test\TestServiceContext.cs" Link="shared\TestServiceContext.cs" />
     <Compile Include="$(KestrelSharedSourceRoot)test\TestConnection.cs" Link="shared\TestConnection.cs" />
     <Compile Include="$(SharedSourceRoot)test\MockTimeProvider.cs" Link="shared\MockTimeProvider.cs" />

+ 1 - 0
src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj

@@ -11,6 +11,7 @@
   <ItemGroup>
     <Compile Include="..\FunctionalTests\**\*.cs" />
     <Compile Include="$(SharedSourceRoot)NullScope.cs" />
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
     <Compile Include="$(KestrelSharedSourceRoot)test\TestServiceContext.cs" Link="shared\TestServiceContext.cs" />
     <Compile Include="$(KestrelSharedSourceRoot)test\TestConnection.cs" Link="shared\TestConnection.cs" />
     <Compile Include="$(SharedSourceRoot)test\MockTimeProvider.cs" Link="shared\MockTimeProvider.cs" />

+ 0 - 109
src/Shared/Metrics/DefaultMeterFactory.cs

@@ -1,109 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Diagnostics.Metrics;
-using System.Linq;
-using Microsoft.Extensions.Options;
-
-namespace Microsoft.Extensions.Metrics;
-
-// TODO: Remove when Metrics DI intergration package is available https://github.com/dotnet/aspnetcore/issues/47618
-internal sealed class DefaultMeterFactory : IMeterFactory
-{
-    private readonly IOptions<MetricsOptions> _options;
-    private readonly IMeterRegistry _meterRegistry;
-    private readonly Dictionary<MeterKey, Meter> _meters = new Dictionary<MeterKey, Meter>();
-
-    public DefaultMeterFactory(IOptions<MetricsOptions> options, IMeterRegistry meterRegistry)
-    {
-        _options = options;
-        _meterRegistry = meterRegistry;
-    }
-
-    public Meter CreateMeter(string name)
-    {
-        return CreateMeterCore(name, version: null, defaultTags: null);
-    }
-
-    public Meter CreateMeter(MeterOptions options)
-    {
-        return CreateMeterCore(options.Name, options.Version, options.DefaultTags);
-    }
-
-    private Meter CreateMeterCore(string name, string? version, IList<KeyValuePair<string, object?>>? defaultTags)
-    {
-        var tags = defaultTags?.ToArray();
-        if (tags != null)
-        {
-            Array.Sort(tags, (t1, t2) => string.Compare(t1.Key, t2.Key, StringComparison.Ordinal));
-        }
-        var key = new MeterKey(name, version, tags);
-
-        if (_meters.TryGetValue(key, out var meter))
-        {
-            return meter;
-        }
-
-        // TODO: Configure meter with default tags.
-        meter = new Meter(name, version);
-        _meters[key] = meter;
-        _meterRegistry.Add(meter);
-
-        return meter;
-    }
-
-    private readonly struct MeterKey : IEquatable<MeterKey>
-    {
-        public MeterKey(string name, string? version, KeyValuePair<string, object?>[]? defaultTags)
-        {
-            Name = name;
-            Version = version;
-            DefaultTags = defaultTags;
-        }
-
-        public string Name { get; }
-        public string? Version { get; }
-        public IList<KeyValuePair<string, object?>>? DefaultTags { get; }
-
-        public bool Equals(MeterKey other)
-        {
-            return Name == other.Name
-                && Version == other.Version
-                && TagsEqual(other);
-        }
-
-        private bool TagsEqual(MeterKey other)
-        {
-            if (DefaultTags is null && other.DefaultTags is null)
-            {
-                return true;
-            }
-            if (DefaultTags is not null && other.DefaultTags is not null && DefaultTags.SequenceEqual(other.DefaultTags))
-            {
-                return true;
-            }
-            return false;
-        }
-
-        public override bool Equals(object? obj)
-        {
-            return obj is MeterKey key && Equals(key);
-        }
-
-        public override int GetHashCode()
-        {
-            var hashCode = new HashCode();
-            hashCode.Add(Name);
-            hashCode.Add(Version);
-            if (DefaultTags is not null)
-            {
-                foreach (var item in DefaultTags)
-                {
-                    hashCode.Add(item);
-                }
-            }
-
-            return hashCode.ToHashCode();
-        }
-    }
-}

+ 0 - 77
src/Shared/Metrics/IMeterFactory.cs

@@ -1,77 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Diagnostics.Metrics;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Microsoft.Extensions.Metrics;
-
-// TODO: Remove when Metrics DI intergration package is available https://github.com/dotnet/aspnetcore/issues/47618
-internal sealed class MetricsOptions
-{
-    public IList<KeyValuePair<string, object?>> DefaultTags { get; } = new List<KeyValuePair<string, object?>>();
-}
-
-internal interface IMetricsBuilder
-{
-    IServiceCollection Services { get; }
-}
-
-internal sealed class MetricsBuilder : IMetricsBuilder
-{
-    public MetricsBuilder(IServiceCollection services) => Services = services;
-    public IServiceCollection Services { get; }
-}
-
-internal sealed class MeterOptions
-{
-    public required string Name { get; set; }
-    public string? Version { get; set; }
-    public IList<KeyValuePair<string, object?>>? DefaultTags { get; set; }
-}
-
-internal interface IMeterFactory
-{
-    Meter CreateMeter(string name);
-    Meter CreateMeter(MeterOptions options);
-}
-
-internal interface IMeterRegistry
-{
-    void Add(Meter meter);
-    bool Contains(Meter meter);
-}
-
-internal sealed class DefaultMeterRegistry : IMeterRegistry, IDisposable
-{
-    private readonly object _lock = new object();
-    private readonly List<Meter> _meters = new List<Meter>();
-
-    public void Add(Meter meter)
-    {
-        lock (_lock)
-        {
-            _meters.Add(meter);
-        }
-    }
-
-    public bool Contains(Meter meter)
-    {
-        lock (_lock)
-        {
-            return _meters.Contains(meter);
-        }
-    }
-
-    public void Dispose()
-    {
-        lock (_lock)
-        {
-            foreach (var meter in _meters)
-            {
-                meter.Dispose();
-            }
-            _meters.Clear();
-        }
-    }
-}

+ 0 - 69
src/Shared/Metrics/InstrumentRecorder.cs

@@ -1,69 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Diagnostics.Metrics;
-
-namespace Microsoft.Extensions.Metrics;
-
-// TODO: Remove when Metrics DI intergration package is available https://github.com/dotnet/aspnetcore/issues/47618
-internal sealed class InstrumentRecorder<T> : IDisposable where T : struct
-{
-    private readonly object _lock = new object();
-    private readonly string _meterName;
-    private readonly string _instrumentName;
-    private readonly MeterListener _meterListener;
-    private readonly List<Measurement<T>> _values;
-    private readonly List<Action<Measurement<T>>> _callbacks;
-
-    public InstrumentRecorder(IMeterRegistry registry, string meterName, string instrumentName, object? state = null)
-    {
-        _meterName = meterName;
-        _instrumentName = instrumentName;
-        _callbacks = new List<Action<Measurement<T>>>();
-        _values = new List<Measurement<T>>();
-        _meterListener = new MeterListener();
-        _meterListener.InstrumentPublished = (instrument, listener) =>
-        {
-            if (instrument.Meter.Name == _meterName && registry.Contains(instrument.Meter) && instrument.Name == _instrumentName)
-            {
-                listener.EnableMeasurementEvents(instrument, state);
-            }
-        };
-        _meterListener.SetMeasurementEventCallback<T>(OnMeasurementRecorded);
-        _meterListener.Start();
-    }
-
-    private void OnMeasurementRecorded(Instrument instrument, T measurement, ReadOnlySpan<KeyValuePair<string, object?>> tags, object? state)
-    {
-        lock (_lock)
-        {
-            var m = new Measurement<T>(measurement, tags);
-            _values.Add(m);
-
-            // Should this happen in the lock?
-            // Is there a better way to notify listeners that there are new measurements?
-            foreach (var callback in _callbacks)
-            {
-                callback(m);
-            }
-        }
-    }
-
-    public void Register(Action<Measurement<T>> callback)
-    {
-        _callbacks.Add(callback);
-    }
-
-    public IReadOnlyList<Measurement<T>> GetMeasurements()
-    {
-        lock (_lock)
-        {
-            return _values.ToArray();
-        }
-    }
-
-    public void Dispose()
-    {
-        _meterListener.Dispose();
-    }
-}

+ 0 - 37
src/Shared/Metrics/MetricsServiceExtensions.cs

@@ -1,37 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using Microsoft.Extensions.DependencyInjection.Extensions;
-using Microsoft.Extensions.Metrics;
-
-namespace Microsoft.Extensions.DependencyInjection;
-
-// TODO: Remove when Metrics DI intergration package is available https://github.com/dotnet/aspnetcore/issues/47618
-internal static class MetricsServiceExtensions
-{
-    public static IServiceCollection AddMetrics(this IServiceCollection services)
-    {
-        ArgumentNullException.ThrowIfNull(services);
-
-        services.TryAddSingleton<IMeterFactory, DefaultMeterFactory>();
-        services.TryAddSingleton<IMeterRegistry, DefaultMeterRegistry>();
-
-        return services;
-    }
-
-    public static IServiceCollection AddMetrics(this IServiceCollection services, Action<IMetricsBuilder> configure)
-    {
-        ArgumentNullException.ThrowIfNull(services);
-
-        services.AddMetrics();
-        configure(new MetricsBuilder(services));
-
-        return services;
-    }
-
-    public static IMetricsBuilder AddDefaultTag(this IMetricsBuilder builder, string name, object? value)
-    {
-        builder.Services.Configure<MetricsOptions>(o => o.DefaultTags.Add(new KeyValuePair<string, object?>(name, value)));
-        return builder;
-    }
-}

+ 45 - 16
src/Shared/Metrics/TestMeterFactory.cs

@@ -2,43 +2,72 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Diagnostics.Metrics;
+using Microsoft.Extensions.Diagnostics.Metrics;
 
-namespace Microsoft.Extensions.Metrics;
+namespace Microsoft.AspNetCore.Testing;
 
-// TODO: Remove when Metrics DI intergration package is available https://github.com/dotnet/aspnetcore/issues/47618
-internal class TestMeterFactory : IMeterFactory
+internal sealed class TestMeterFactory : IMeterFactory
 {
     public List<Meter> Meters { get; } = new List<Meter>();
 
-    public Meter CreateMeter(string name)
+    public Meter Create(MeterOptions options)
     {
-        var meter = new Meter(name);
+        var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
         Meters.Add(meter);
         return meter;
     }
 
-    public Meter CreateMeter(MeterOptions options)
+    public void Dispose()
     {
-        var meter = new Meter(options.Name, options.Version);
-        Meters.Add(meter);
-        return meter;
+        foreach (var meter in Meters)
+        {
+            meter.Dispose();
+        }
+
+        Meters.Clear();
     }
 }
 
-internal class TestMeterRegistry : IMeterRegistry
+internal sealed class MeasurementReporter<T> : IDisposable where T : struct
 {
-    private readonly List<Meter> _meters;
+    private readonly string _meterName;
+    private readonly string _instrumentName;
+    private readonly List<Action<Measurement<T>>> _callbacks;
+    private readonly MeterListener _meterListener;
 
-    public TestMeterRegistry() : this(new List<Meter>())
+    public MeasurementReporter(IMeterFactory factory, string meterName, string instrumentName, object state = null)
     {
+        _meterName = meterName;
+        _instrumentName = instrumentName;
+        _callbacks = new List<Action<Measurement<T>>>();
+        _meterListener = new MeterListener();
+        _meterListener.InstrumentPublished = (instrument, listener) =>
+        {
+            if (instrument.Meter.Name == _meterName && instrument.Meter.Scope == factory && instrument.Name == _instrumentName)
+            {
+                listener.EnableMeasurementEvents(instrument, state);
+            }
+        };
+        _meterListener.SetMeasurementEventCallback<T>(OnMeasurementRecorded);
+        _meterListener.Start();
     }
 
-    public TestMeterRegistry(List<Meter> meters)
+    private void OnMeasurementRecorded(Instrument instrument, T measurement, ReadOnlySpan<KeyValuePair<string, object>> tags, object state)
     {
-        _meters = meters;
+        var m = new Measurement<T>(measurement, tags);
+        foreach (var callback in _callbacks)
+        {
+            callback(m);
+        }
     }
 
-    public void Add(Meter meter) => _meters.Add(meter);
+    public void Register(Action<Measurement<T>> callback)
+    {
+        _callbacks.Add(callback);
+    }
 
-    public bool Contains(Meter meter) => _meters.Contains(meter);
+    public void Dispose()
+    {
+        _meterListener.Dispose();
+    }
 }

+ 2 - 2
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionsMetrics.cs

@@ -3,7 +3,7 @@
 
 using System.Diagnostics;
 using System.Diagnostics.Metrics;
-using Microsoft.Extensions.Metrics;
+using Microsoft.Extensions.Diagnostics.Metrics;
 
 namespace Microsoft.AspNetCore.Http.Connections.Internal;
 
@@ -32,7 +32,7 @@ internal sealed class HttpConnectionsMetrics : IDisposable
 
     public HttpConnectionsMetrics(IMeterFactory meterFactory)
     {
-        _meter = meterFactory.CreateMeter(MeterName);
+        _meter = meterFactory.Create(MeterName);
 
         _currentConnectionsCounter = _meter.CreateUpDownCounter<long>(
             "current-connections",

+ 1 - 0
src/SignalR/common/Http.Connections/src/Microsoft.AspNetCore.Http.Connections.csproj

@@ -36,6 +36,7 @@
     <Reference Include="Microsoft.AspNetCore.Http" />
     <Reference Include="Microsoft.AspNetCore.Routing" />
     <Reference Include="Microsoft.AspNetCore.WebSockets" />
+    <Reference Include="Microsoft.Extensions.Diagnostics" />
   </ItemGroup>
 
   <ItemGroup>

+ 3 - 4
src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs

@@ -36,7 +36,6 @@ using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging.Testing;
-using Microsoft.Extensions.Metrics;
 using Microsoft.Extensions.Options;
 using Microsoft.Extensions.Primitives;
 using Microsoft.IdentityModel.Tokens;
@@ -1091,9 +1090,9 @@ public class HttpConnectionDispatcherTests : VerifiableLoggedTest
         using (StartVerifiableLog())
         {
             var testMeterFactory = new TestMeterFactory();
-            using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration");
-            using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections");
-            using var currentTransports = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-transports");
+            using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, HttpConnectionsMetrics.MeterName, "connection-duration");
+            using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, HttpConnectionsMetrics.MeterName, "current-connections");
+            using var currentTransports = new InstrumentRecorder<long>(testMeterFactory, HttpConnectionsMetrics.MeterName, "current-transports");
 
             var metrics = new HttpConnectionsMetrics(testMeterFactory);
             var manager = CreateConnectionManager(LoggerFactory, metrics);

+ 4 - 5
src/SignalR/common/Http.Connections/test/HttpConnectionManagerTests.cs

@@ -13,7 +13,6 @@ using Microsoft.AspNetCore.SignalR.Tests;
 using Microsoft.AspNetCore.Testing;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Metrics;
 using Microsoft.Extensions.Options;
 using Xunit;
 
@@ -430,8 +429,8 @@ public class HttpConnectionManagerTests : VerifiableLoggedTest
         using (StartVerifiableLog())
         {
             var testMeterFactory = new TestMeterFactory();
-            using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration");
-            using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections");
+            using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, HttpConnectionsMetrics.MeterName, "connection-duration");
+            using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, HttpConnectionsMetrics.MeterName, "current-connections");
 
             var connectionManager = CreateConnectionManager(LoggerFactory, metrics: new HttpConnectionsMetrics(testMeterFactory));
             var connection = connectionManager.CreateConnection();
@@ -459,8 +458,8 @@ public class HttpConnectionManagerTests : VerifiableLoggedTest
             var connectionManager = CreateConnectionManager(LoggerFactory, metrics: new HttpConnectionsMetrics(testMeterFactory));
             var connection = connectionManager.CreateConnection();
 
-            using var connectionDuration = new InstrumentRecorder<double>(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "connection-duration");
-            using var currentConnections = new InstrumentRecorder<long>(new TestMeterRegistry(testMeterFactory.Meters), HttpConnectionsMetrics.MeterName, "current-connections");
+            using var connectionDuration = new InstrumentRecorder<double>(testMeterFactory, HttpConnectionsMetrics.MeterName, "connection-duration");
+            using var currentConnections = new InstrumentRecorder<long>(testMeterFactory, HttpConnectionsMetrics.MeterName, "current-connections");
 
             Assert.NotNull(connection.ConnectionId);
 

+ 1 - 0
src/SignalR/common/Http.Connections/test/Microsoft.AspNetCore.Http.Connections.Tests.csproj

@@ -8,6 +8,7 @@
     <Compile Include="$(SharedSourceRoot)Buffers.Testing\**\*.cs" />
     <Compile Include="$(SharedSourceRoot)SyncPoint\SyncPoint.cs" />
     <Compile Include="$(SharedSourceRoot)EventSource.Testing\TestEventListener.cs" />
+    <Compile Include="$(SharedSourceRoot)Metrics\TestMeterFactory.cs" LinkBase="shared" />
   </ItemGroup>
 
   <ItemGroup>

+ 1 - 0
src/SignalR/server/SignalR/src/SignalRDependencyInjectionExtensions.cs

@@ -5,6 +5,7 @@ using System.Diagnostics.CodeAnalysis;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.SignalR;
 using Microsoft.Extensions.DependencyInjection.Extensions;
+using Microsoft.Extensions.Diagnostics.Metrics;
 using Microsoft.Extensions.Options;
 
 namespace Microsoft.Extensions.DependencyInjection;