-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
There are multiple uses of MakeGenericType() and MakeGenericMethod() throughout the Microsoft.AspNetCore.Components and Microsoft.JSInterop projects that make them unsafe for AOT scenarios. Initially it was believed that the warnings surrounding these would be suppressible since these projects are already trim-safe, but there are multiple places where we cannot guarantee the safety of the suppression.
During review of #45580, there was the suggestion of exploring a non-dynamic code fallback such as here. Further investigation found that the performance degradation would make this a poor approach when dealing with Blazor.
Describe the solution you'd like
The below uses of MakeGenericMethod() and MakeGenericType() need to either have an AOT-safe fallback or a refactor (e.g. source generation) which allows these type-generic methods to not require JIT compilation.
Microsoft.AspNetCore.Components
Microsoft.JSInterop
- DotNetDispatcher.GetTaskByType()
- TaskGenericUtil.GetTaskResult()
- TaskGenericUtil.CreateResultSetter()
- DotNetObjectReferenceJsonConverterFactory.CreateConverter()
Additional context
Linked to #45578, the other part of Web UI's remaining work in #45473.
AOT analysis for these projects is already turned off by #45604.