diff --git a/src/DataProtection/Extensions/src/DataProtectionProvider.cs b/src/DataProtection/Extensions/src/DataProtectionProvider.cs index 895444333d16..23f7a15d1b5f 100644 --- a/src/DataProtection/Extensions/src/DataProtectionProvider.cs +++ b/src/DataProtection/Extensions/src/DataProtectionProvider.cs @@ -146,9 +146,6 @@ internal static IDataProtectionProvider CreateProvider( setupAction(builder); // extract the provider instance from the service collection - // TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425 -#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. return serviceCollection.BuildServiceProvider().GetRequiredService(); -#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. } } diff --git a/src/DefaultBuilder/src/WebApplicationBuilder.cs b/src/DefaultBuilder/src/WebApplicationBuilder.cs index a67653f56b3d..3da1ac4e83a7 100644 --- a/src/DefaultBuilder/src/WebApplicationBuilder.cs +++ b/src/DefaultBuilder/src/WebApplicationBuilder.cs @@ -33,8 +33,6 @@ internal WebApplicationBuilder(WebApplicationOptions options, ActionThe . public virtual IServiceProvider CreateServiceProvider(IServiceCollection services) { - // TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425 -#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. return services.BuildServiceProvider(); -#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. } } diff --git a/src/Hosting/Hosting/src/WebHostBuilder.cs b/src/Hosting/Hosting/src/WebHostBuilder.cs index 81dc2ffef3df..0bcf9f15db84 100644 --- a/src/Hosting/Hosting/src/WebHostBuilder.cs +++ b/src/Hosting/Hosting/src/WebHostBuilder.cs @@ -197,10 +197,7 @@ public IWebHost Build() static IServiceProvider GetProviderFromFactory(IServiceCollection collection) { - // TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425 -#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. var provider = collection.BuildServiceProvider(); -#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. var factory = provider.GetService>(); if (factory != null && factory is not DefaultServiceProviderFactory) diff --git a/src/Hosting/Hosting/src/WebHostBuilderExtensions.cs b/src/Hosting/Hosting/src/WebHostBuilderExtensions.cs index cf924e8750f3..7d6cc792744d 100644 --- a/src/Hosting/Hosting/src/WebHostBuilderExtensions.cs +++ b/src/Hosting/Hosting/src/WebHostBuilderExtensions.cs @@ -204,10 +204,7 @@ public static IWebHostBuilder UseDefaultServiceProvider(this IWebHostBuilder hos { var options = new ServiceProviderOptions(); configure(context, options); - // TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425 -#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. services.Replace(ServiceDescriptor.Singleton>(new DefaultServiceProviderFactory(options))); -#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. }); }