dotnet / dotnet/command-line-api

Fix `IL2091` by annotating the `T` with `[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]`

Open
#2,173 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

I don't understand why the referenced issue is justification for suppressing these warnings. It might be better if we wrote it out here.

I believe you could fix `IL2091` by annotating the `T` with `[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]`. See https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/fixing-warnings#dynamicallyaccessedmembers

_Originally posted by @eerhardt in https://github.com/dotnet/command-line-api/pull/2127#discussion_r1171504265_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.