Linker and Analyzer warning on unsupported type
- Dominant language
- C#
- Stars
- 392
- Forks
- 128
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 2
Description
The set of warnings:
- DynamicallyAccessedMembersIsNotAllowedOnMethods (IL2041)
- DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStrings (IL2097)
- DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStrings (IL2098)
- DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStrings (IL2099)
- DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStrings (IL2106)
Verify that DynamicallyAccessedMembers is not being used in an unsupported. To do this both tools check for DynamicallyAccessedMemberTypes not being None. In the following case:
```c#
public class ClassWithUnsupportedField {
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.None)]
static object _annotationOnWrongType;
}
```
The field _annotationOnWrongType has directly a DynamicallyAccessedMemberTypes.None annotation, but is bypassed by both linker and analyzer. The objective of this issue is to discuss if this use case should generate the unsupported type warning.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.