Open
Description
Context: https://github.com/dotnet/designs/blob/main/accepted/2020/linking-libraries.md#Feature-Switches
Context: https://docs.microsoft.com/en-us/dotnet/api/system.appcontext.trygetswitch?view=net-5.0#System_AppContext_TryGetSwitch_System_String_System_Boolean__
Context: dotnet/runtime@a547d41
In the .NET 6 timeframe, the linker will be able to "know" about "feature switches", and remove code accordingly.
Additionally, an XML file can be used to "tell" the linker which methods to remove based on the feature:
Should we consider adding a "feature switch" around anything using System.Linq.Expressions
, so that if the feature isn't used, it can be linked away?