-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Mono.Linker.LinkerFatalErrorException: "Error processing method" at GetValueNodeFromGenericArgument #43222
Comments
@eerhardt FYI |
Tagging subscribers to this area: @eiriktsarpalis, @jeffhandley |
@marek-safar @vitek-karas - I think this belongs in the mono/linker repo, but I don't have permissions to transfer it. This may be related to dotnet/linker#1500 - it is the same exception, but a different set of repro steps. |
/move to mono/linker |
FYI - this also repros on a recent RC2 build:
|
I can confirm that this a real bug in the linker. Since I didn't find a way to move the issue I filed a copy in dotnet/linker#1559. There's no simple workaround for the bug, but there are several ways to get the desired results. In this specific case a good way how to do the same and avoid the bug would be: public static void GenericMethod<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] T>()
{
T[] value = null;
JsonSerializer.Serialize(value, typeof(T[]));
} This will generate a trim analysis warning in the linker (Which is by default suppressed, but it can be suppressed in this method specifically as the method will work correctly). It uses the Adding the annotation on the generic parameter of the method effectively propagates the requirements one frame above and so the end-to-end behavior will be the same as if the bug is fixed. |
Moved to dotnet/linker#1559 |
Hello,
Can't publish Blazor WebAssembly application with some specific code.
Steps To Reproduce
Install .NET 5 RC1
Create some project:
Exception
Further technical details
Please, feel free to ask for the details.
Thank you in advance for you help.
The text was updated successfully, but these errors were encountered: