Skip to content
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

propertyInfo.PropertyType.GetProperty("") #3220

Open
Kiryuumaru opened this issue Jun 22, 2023 · 1 comment
Open

propertyInfo.PropertyType.GetProperty("") #3220

Kiryuumaru opened this issue Jun 22, 2023 · 1 comment

Comments

@Kiryuumaru
Copy link

propertyInfo.PropertyType.GetProperty("")

This shows warning:
Severity Code Description Project File Line Suppression State
Warning IL2075 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The return value of method 'System.Reflection.PropertyInfo.PropertyType.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

@MichalStrehovsky
Copy link
Member

How do you obtain the value in propertyInfo? This is complaining because the result of propertyInfo.PropertyType is an unknown type and accessing a property on a type that is not known at the time of trimming might result in the property being trimmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants