-
Notifications
You must be signed in to change notification settings - Fork 204
InputBase<TValue> produces trim warnings IL2091 for built in types #11718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@alexaka1 thanks for contacting us. Seems like I'm not sure if the issue is that, or if it's something on the generated code that is not being properly annotated. Moving this to the razor repo so that they can take a look at the generated code. |
I have created a small repro: https://github.com/alexaka1/repro-dotnet-razor-11718
|
If I set |
@jjonescz Please take a look. |
The generated code looks like this: public static void CreateInputRadioGroup_0<TValue>(...)
{
__builder.OpenComponent<global::Microsoft.AspNetCore.Components.Forms.InputRadioGroup<TValue>>(seq); Where we get warning warning IL2091: 'TValue' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in 'Microsoft.AspNetCore.Components.Forms.InputRadioGroup'
If I understand the trimmer warning correctly, Razor needs to look at public static void CreateInputRadioGroup_0<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TValue>(...)
{
__builder.OpenComponent<global::Microsoft.AspNetCore.Components.Forms.InputRadioGroup<TValue>>(seq); |
Thanks @jjonescz. Any chance this lands in current LTS and STS? |
This fix is currently targeting .NET 10. I don't think it meets the bar for backporting to earlier releases. |
|
Originally posted by @alexaka1 in #44845
I have the following enabled in my project:
The text was updated successfully, but these errors were encountered: