SPC030202: Do not access SharePoint API via reflection

It is not supported to access non public properties or methods of the SharePoint API, e.g. via reflection.

TypeName: DoNotUseReflectionToAccessSharePointAPI
CheckId: SPC030202
Severity: CriticalError
Type: AssemblyFileReference

Remove the statement for accessing the SharePoint API via a reflection call.


The rule can lead to wrong results. The rule checks for appearances of Type.GetMethod(), Type.GetProperty(), Type.GetMethods(), Type.GetProperties() with BindingFlags.NonPublic and checks if the assembly references SharePoint assemblies. This indicates a non allowed access to a non public property or method. The rule cannot check if this operation has been applied for the SharePoint API but assumes that.

comments powered by Disqus