Expand Minimize

Do not update list of blocked extensions

The assembly should not access property Microsoft.SharePoint.Administration.SPWebApplication.BlockedFileExtensions and also update the web application. The rule assumes that the list of blocked file extensions has been changed by the code.

CheckId SPC020201
TypeName DoNotUpdateBlockedFileExtensions
Severity CriticalWarning
Type Assembly

Remove calls to method Update() of Microsoft.SharePoint.Administration.SPWebApplication.BlockedFileExtensions.

The rule cannot check if the list of blocked file extensions 'Microsoft.SharePoint.Administration.SPWebApplication.BlockedFileExtensions' has been changed, because the list is a simple string list. But if Microsoft.SharePoint.Administration.SPWebApplication.Update is called in the same assembly it is assumed that the list may have changed

To suppress this violation in managed code add the following attribute to the method which contains the instruction (available since SPCAF version v5.2). Learn more about SuppressMessage here.

// Important: Ensure to have #define CODE_ANALYSIS at the beginning of your .cs file
[SuppressMessage("SPCAF.Rules.SecurityGroup", "SPC020201:DoNotUpdateBlockedFileExtensions", Justification = "Provide reason for suppression here")]
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.