Skip to content

Commit d8c97de

Browse files
committed
Remove AOT warning suppressions
...introduced in dotnet#45604 now that dotnet/runtime#79425 is available.
1 parent ad2f29f commit d8c97de

File tree

8 files changed

+0
-24
lines changed

8 files changed

+0
-24
lines changed

src/DataProtection/Extensions/src/DataProtectionProvider.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ internal static IDataProtectionProvider CreateProvider(
146146
setupAction(builder);
147147

148148
// extract the provider instance from the service collection
149-
// TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425
150-
#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
151149
return serviceCollection.BuildServiceProvider().GetRequiredService<IDataProtectionProvider>();
152-
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
153150
}
154151
}

src/DefaultBuilder/src/WebApplicationBuilder.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ internal WebApplicationBuilder(WebApplicationOptions options, Action<IHostBuilde
3333

3434
configuration.AddEnvironmentVariables(prefix: "ASPNETCORE_");
3535

36-
// TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425
37-
#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
3836
_hostApplicationBuilder = new HostApplicationBuilder(new HostApplicationBuilderSettings
3937
{
4038
Args = options.Args,
@@ -43,7 +41,6 @@ internal WebApplicationBuilder(WebApplicationOptions options, Action<IHostBuilde
4341
ContentRootPath = options.ContentRootPath,
4442
Configuration = configuration,
4543
});
46-
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
4744

4845
// Set WebRootPath if necessary
4946
if (options.WebRootPath is not null)

src/Hosting/Hosting/src/GenericHost/GenericWebHostBuilder.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,7 @@ public IWebHostBuilder UseDefaultServiceProvider(Action<WebHostBuilderContext, S
211211
var webHostBuilderContext = GetWebHostBuilderContext(context);
212212
var options = new ServiceProviderOptions();
213213
configure(webHostBuilderContext, options);
214-
// TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425
215-
#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
216214
return new DefaultServiceProviderFactory(options);
217-
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
218215
});
219216

220217
return this;

src/Hosting/Hosting/src/Internal/StartupLoader.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,7 @@ IServiceProvider ConfigureServicesWithContainerConfiguration(IServiceCollection
161161
applicationServiceProvider = serviceProviderFactory.CreateServiceProvider(builder);
162162
}
163163

164-
// TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425
165-
#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
166164
return applicationServiceProvider ?? services.BuildServiceProvider();
167-
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
168165
}
169166
}
170167

src/Hosting/Hosting/src/Internal/WebHost.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ public void Initialize()
104104
// EnsureApplicationServices may have failed due to a missing or throwing Startup class.
105105
if (_applicationServices == null)
106106
{
107-
// TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425
108-
#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
109107
_applicationServices = _applicationServiceCollection.BuildServiceProvider();
110-
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
111108
}
112109

113110
if (!_options.CaptureStartupErrors)

src/Hosting/Hosting/src/Startup/StartupBase.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ public virtual void ConfigureServices(IServiceCollection services)
3838
/// <returns>The <see cref="IServiceProvider"/>.</returns>
3939
public virtual IServiceProvider CreateServiceProvider(IServiceCollection services)
4040
{
41-
// TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425
42-
#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
4341
return services.BuildServiceProvider();
44-
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
4542
}
4643
}
4744

src/Hosting/Hosting/src/WebHostBuilder.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ public IWebHost Build()
197197

198198
static IServiceProvider GetProviderFromFactory(IServiceCollection collection)
199199
{
200-
// TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425
201-
#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
202200
var provider = collection.BuildServiceProvider();
203-
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
204201
var factory = provider.GetService<IServiceProviderFactory<IServiceCollection>>();
205202

206203
if (factory != null && factory is not DefaultServiceProviderFactory)

src/Hosting/Hosting/src/WebHostBuilderExtensions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@ public static IWebHostBuilder UseDefaultServiceProvider(this IWebHostBuilder hos
204204
{
205205
var options = new ServiceProviderOptions();
206206
configure(context, options);
207-
// TODO: Remove when DI no longer has RequiresDynamicCodeAttribute https://github.com/dotnet/runtime/pull/79425
208-
#pragma warning disable IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
209207
services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(new DefaultServiceProviderFactory(options)));
210-
#pragma warning restore IL3050 // Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.
211208
});
212209
}
213210

0 commit comments

Comments
 (0)