dotnet / dotnet/command-line-api

System.CommandLine needs reflection to work?

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

Description

I've tried to compile my little app (~400 lines of C#, zero use of reflection) that references and makes use of latest System.CommandLine (2.0.0-beta3.22101.1 at the time of writing) with NativeAOT and reflection disabled (IlcDisableReflection=true) and app stopped working. Enabling reflection makes it work again. Then I tried to remove usage of System.CommandLine from the app, but keep reflection disabled and app works fine. This leads me to believe that something in System.CommandLine needs that reflection so bad? Why?

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.