You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\Users\KuroPC\source\repos\MudBlazor\src\MudBlazor\obj\Debug\net9.0\generated\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Components_Snackbar_MudSnackbarElement_razor.g.cs(236,13,236,98):
error IL2111: Method 'Microsoft.AspNetCore.Components.DynamicComponent.Type.set' with parameters or return value with `DynamicallyAccessedMembersAttribute` is accessed via reflection. Trimmer can't guarantee availability of the requirements of the method.
However, since both the DynamicComponent and the ComponentType property in SnackbarMessage have the same DAM annotation, why does this result in an error? There are no RequiresUnreferencedCode attributes on DynamicComponent, so I would expect that if the annotations match, there shouldn't be any issues.
Here’s the generated Razor code lines that it complains on:
The
DynamicComponent
has the following signature:Now, if you have a class that uses the
DynamicComponent
:And you use it like this:
This will always result in an error / warning:
However, since both the
DynamicComponent
and theComponentType
property inSnackbarMessage
have the same DAM annotation, why does this result in an error? There are noRequiresUnreferencedCode
attributes onDynamicComponent
, so I would expect that if the annotations match, there shouldn't be any issues.Here’s the generated Razor code lines that it complains on:
NB! This was not an issue with the .NET 8 SDK and it had the same DAM annotation like in NET9.
The text was updated successfully, but these errors were encountered: