-
Notifications
You must be signed in to change notification settings - Fork 128
Description
In System.ComponentModel.TypeConverter, there are a few instances where it will call Type.GetType(string), and then use the Type to pass into other methods.
An example is the ProvidePropertyAttribute - https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.providepropertyattribute
This attribute can take a string receiverTypeName parameter in its constructor. In order to support this, we need to mark that parameter as DynamicallyAccessedMembers so the linker will see that the Type is being used and not trim the Type. However, in order to use DynamicallyAccessedMembers, we need to specify a DynamicallyAccessedMemberTypes enum. Putting DynamicallyAccessedMemberTypes.None should mark the Type as being preserved, but not mark any of its members.
This also applies to the EditorAttribute's string? baseTypeName parameter. The code calls Type.GetType using this string, but doesn't reflect on anything else on the Type. The Type needs to be preserved, but not necessarily any of its members.
For now I've been using DynamicallyAccessedMemberTypes.PublicParameterlessConstructor to preserve these Types.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status