-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Labels
Description
When passing in variable.GetType() into a method that is annotated with DynamicallyAccessedMembers, the linker should be able to statically infer the Type if the Type of the variable is sealed. However, the linker is not preserving the correct members on the Type in this situation.
For example,
public class TraceLoggingEventTypes
{
internal TraceLoggingEventTypes(
string name,
EventTags tags,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type type)
... var msg = new { message = msgString };
var tlet = new TraceLoggingEventTypes(EventName, EventTags.None, msg.GetType());When linking code like the above, the message property is getting trimmed from the anonymous type.
See my attempted code change for this scenario in EventSource.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status