RegistryPermission

Table A-9 shows the required RegistryPermission settings for system registry functions in .NET targets.

Table A-9: Required RegistryPermission settings for system functions

System function

Permission required

RegistryGet, RegistryKeys, RegistryValues

Read

RegistrySet

Write; if registry key does not exist, requires Create

RegistryDelete

Read and Write

Table A-10 shows the required RegistryPermission settings for MLSync object functions in .NET targets.

Table A-10: Required RegistryPermission settings for MLSync functions

MLSync function

Permission required

GetObjectRevisionFromRegistry, GetsSyncRegistryProperties

Read on HKEY_CURRENT_USER registry key

GetDBMLSyncPath

Read on the Software\Sybase\SQL Anywhere registry keys under HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE

SetsSyncRegistryProperties

Unrestricted on HKEY_CURRENT_USER registry key

Example 1

This example for a Windows Forms application grants read permission for the HKEY_CURRENT_USER registry key, which extends to its subkeys:

<IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="HKEY_CURRENT_USER" />

Example 2

This example for a Web Forms application grants read permission for the HKEY_CURRENT_USER registry key, which extends to its subkeys:

<IPermission class="RegistryPermission" version="1 Read="HKEY_CURRENT_USER" />