Expand Minimize

SPC020612: Do not define 'RegistryPermission' with 'Unrestricted=true'

The CAS Policy for System.Security.Permissions.RegistryPermission with setting 'Unrestricted=true' is not allowed.

CheckId SPC020612
TypeName DoNotDefineUnrestrictedRegistryPermission
Severity Error
Type PermissionSet

Remove permission 'RegistryPermission' with setting 'Unrestricted=true' or remove permission completely.
Bad Practice

<Solution xmlns="http://schemas.microsoft.com/sharepoint/">
  <CodeAccessSecurity>
    <PolicyItem>
      <PermissionSet class="NamedPermissionSet" version="1">
      ...
        <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="True" />
      ...
      </PermissionSet>
    <PolicyItem>
  <CodeAccessSecurity>
</Solution>

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.