Setting the .NET Trust Level for your Application

Trust Levels

Microsoft .NET applications can run in any of the following trust levels:

Medium trust restrictions

Many application hosting service providers run applications in the ‘Medium trust’ level.  The main constraints placed on Medium trust Web applications are:

You are also prevented from calling unmanaged code or from using Enterprise Services.

Setting the trust level for your Iron Speed Designer-application

Iron Speed Designer requires a custom or modified Medium Trust policy.  Specifically, the following exceptions to the Medium Trust policy must be applied based on the underlying database product used by the application:

Please note that if you are using Microsoft Access, you also need read and write access to the file system to be able to read and save data.  The Microsoft Access database must also be resident in the application folder.

Event logging must be turned off

To run Iron Speed Designer applications in the Medium Trust environment, the Event Logging feature must be turned off in your application’s Web.config file.

<add key="LogEvents" value="false" />

This event log feature is turned off by default.

AllowPartiallyTrustedCallers attribute (APTCA)

All assemblies or DLLs used in an application must have the Allow Partially Trusted Callers Attribute (APTCA) specified in order to run under Medium Trust.  All DLLs included by Iron Speed Designer are already marked with the APTCA attribute, including BaseClasses.DLL and Reports.DLL.  Any additional DLLs included in your application must also be marked with this attribute.

The following code must be added in the DLL’s AssemblyInfo.vb file to make assemblies APTCA compatible.

Imports System.Security

<Assembly: AllowPartiallyTrustedCallers()>

The following DLLs used by Iron Speed Designer applications are marked with the APTCA attribute:

DLL

Notes

BaseClasses.dll

APTCA Marked

AjaxControlToolkit.dll

APTCA Marked

Ciloci.Flee.dll

APTCA Marked

FredCK.FCKeditorV2.dll

APTCA Marked

MySql.Data.dll

APTCA Marked

Report.dll

APTCA Marked

System.Web.Extensions.dll

APTCA Marked

Validators.dll

No (can run under medium trust)

CarlosAg.ExcelXmlWriter.dll

No (can run under medium trust)

The following DLLs do not have the APTCA attribute specified and will not run under Medium Trust:

DLL

Notes

BaseClasses.dll

Iron Speed Designer V5.2.X or earlier

MySql.Data.dll 

Version 5.0.7.0 or earlier

Report.dll

Iron Speed Designer V5.2.X or earlier

Recaptcha.dll

Iron Speed Designer V9.0.0 and later

Additional Reading

http://msdn2.microsoft.com/en-us/library/ms998341.aspx

See Also

Deploying to Application Hosting Service Providers

Example: Deploying to 1&1

Example: Deploying to CrystalTech

Example: Deploying to DiscountASP.NET

Example: Deploying to GoDaddy.com

Disabling Event Viewer Logging

Individual Hosting Provider Notes

Setting the .NET Trust Level for your Application