You can add permission, including ReflectionPermission, OleDbPermission, and FileIOPermission, to the web.config file. Note that ComponentOne controls will not work in an environment where reflection is not allowed. Complete the steps in the Modifying or Editing the Config File topic to create or modify a policy file before completing the following.
By default ReflectionPermission is not available in a medium trust environment. ASP.NET Web Forms Edition controls require reflection permission because LicenseManager.Validate() causes a link demand for full trust.
To add reflection permission, follow these steps:
<SecurityClasses>
<SecurityClass Name="ReflectionPermission" Description="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
...
</SecurityClasses>
<NamedPermissionSets>
<PermissionSet class="NamedPermissionSet" version="1" Name="ASP.Net">
<IPermission
class="ReflectionPermission"
version="1"
Flags="ReflectionEmit,MemberAccess" />
...
</PermissionSet>
</NamedPermissionSets>
By default OleDbPermission is not available in a medium trust environment. This means you cannot use the ADO.NET managed OLE DB data provider to access databases. If you wish to use the ADO.NET managed OLE DB data provider to access databases, you must modify the web_mediumtrust.config file.
To add OleDbPermission, follow these steps:
<SecurityClasses>
<SecurityClass Name="OleDbPermission" Description="System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
...
</SecurityClasses>
<NamedPermissionSets>
<PermissionSet class="NamedPermissionSet" version="1" Name="ASP.Net">
<IPermission class="OleDbPermission" version="1" Unrestricted="true"/>
...
</PermissionSet>
</NamedPermissionSets>
By default, FileIOPermission is not available in a medium trust environment. This means no file access is permitted outside of the application's virtual directory hierarchy. If you wish to allow additional file permissions, you must modify the web_mediumtrust.config file.
To modify FileIOPermission to allow read access to a specific directory outside of the application's virtual directory hierarchy, complete the following steps:
<SecurityClasses>
<SecurityClass Name="FileIOPermission" Description="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
...
</SecurityClasses>
<NamedPermissionSets>
<PermissionSet class="NamedPermissionSet" version="1" Name="ASP.Net">
...
<IPermission class="FileIOPermission" version="1" Read="C:\SomeDir;$AppDir$" Write="$AppDir$" Append="$AppDir$" PathDiscovery="$AppDir$" />
...
</PermissionSet>
</NamedPermissionSets>