EnableAOTAnalyzer for Microsoft.Extensions.DependencyInjection#73829
EnableAOTAnalyzer for Microsoft.Extensions.DependencyInjection#73829eerhardt merged 1 commit intodotnet:mainfrom
Conversation
Using MEDI is annotated as RequiresDynamicCode because it supports enumerable and generic servcies with ValueTypes. When using DI with ValuesTypes, the array and generic code might not be available. Contributes to dotnet#71654
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @dotnet/area-extensions-dependencyinjection Issue DetailsUsing MEDI is annotated as RequiresDynamicCode because it supports enumerable and generic servcies with ValueTypes. When using DI with ValuesTypes, the array and generic code might not be available. At runtime, MEDI checks RuntimeFeature.IsDynamicCodeCompiled and switches to use a pure Reflection based implementation, so the System.Reflection.Emit code is not used with NativeAOT. This allows some limited usages of MEDI to work in NativeAOT, but not all features are supported. Contributes to #71654
|
|
|
Using MEDI is annotated as RequiresDynamicCode because it supports enumerable and generic servcies with ValueTypes. When using DI with ValuesTypes, the array and generic code might not be available.
At runtime, MEDI checks RuntimeFeature.IsDynamicCodeCompiled and switches to use a pure Reflection based implementation, so the System.Reflection.Emit code is not used with NativeAOT. This allows some limited usages of MEDI to work in NativeAOT, but not all features are supported.
Contributes to #71654