Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented May 14, 2022

Fixes #1667

@JamesNK JamesNK requested a review from captainsafia May 14, 2022 13:02
return null;
}

[SuppressMessage("Trimming", "IL2075", Justification = "Modern apps published with trimming will be using newer Grpc.Tools and won't use this fallback.")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this guaranteed and/or are the situations where it happens very edge-casey?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edge-casey. Apps won't use this path unless they use a Grpc.Tools version that's 2+ years old.

// Grpc.AspNetCore.Server uses reflection to find the bind service method.
// Grpc.AspNetCore.Server.Reflection uses reflection to find the descriptor property.
// DynamicallyAccessedMembersAttribute instructs the linker to never trim the members.
private const DynamicallyAccessedMemberTypes ServiceBinderAccessibility = DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.PublicProperties;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtattermusch FYI an update to Grpc.Core.Api. Just changes a value on an attribute. No impact on compatibility.

@JamesNK JamesNK merged commit be641b6 into grpc:master May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Benchmark application doesn't compile on net7.0

2 participants