dotnet / dotnet/aspnetcore

Blazor IJSInProcessObjectReference.Invoke is attributed with RequiresUnreferencedCode

Open
#58,712 1 comment 0 reactions 0 assignees View on GitHub
area-blazor copilot-candidate
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

Hello, I have recently found that `IJSInProcessObjectReference.Invoke` is attributed under `[RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")]` [here](https://github.com/dotnet/aspnetcore/blob/3f8edf130a14d34024a42ebd678fa3f699ef5916/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessObjectReference.cs#L21).

However we have add `[DynamicallyAccessedMembers(JsonSerialized)]` for its `TValue`, so it seems unnecessary to use `RequiresUnreferencedCode`?

And we didn't do that in `IJSObjectReference`, so I believe it should be a mistake.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.