Skip to content

Make Microsoft.Extensions.Hosting linker friendly #40396

Description

@davidfowl

Now that we've annotated DI, these helpers on top also need annotations.

ILLink : Trim analysis warning IL2006: Microsoft.Extensions.DependencyInjection.ServiceCollectionHostedServiceExtensions.AddHostedService<THostedService>(IServiceCollection): The generic parameter 'THostedService' from 'Microsoft.Extensions.DependencyInjection.ServiceCollectionHostedServiceExtensions.AddHostedService<THostedService>(IServiceCollection)' with dynamically accessed member kinds 'None' is passed into the generic parameter 'TImplementation' from 'Microsoft.Extensions.DependencyInjection.ServiceDescriptor.Singleton<TService,TImplementation>()' which requires dynamically accessed member kinds 'PublicConstructors'. To fix this add DynamicallyAccessedMembersAttribute to it and specify at least these member kinds 'PublicConstructors'. [C:\Users\davifowl\source\repos\WebApplication60\WebApplication60\WebApplication60.csproj]

cc @eerhardt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions