Developing for Medium Trust

Development For Medium Trust

More and more ASP.NET hosting providers are enforcing a Medium Trust Policy on their servers. Therefore it is important to make mojoPortal and add on features work (as much as possible) in environments where medium trust is enforced.

Information about configuring mojoPortal for medium trust are found here:

The purpose of this article is just to make some notes about things to avoid as a developer to make sure your feature(s) work in medium trust if possible. There is no substitute for testing, you can configure medium trust on your dev environement by putting this in the system.web section of Web.config:

<trust level="Medium" originUrl="" />

Some things to avoid that definitely don't work are:

  • System.Reflection - you can't do much with System.Reflection under medium trust
  • Serialization - don't use BinaryFormatter or SoapFormatter

Additional Developer Resources Related to Medium Trust

Enabling WePermission in Medium Trust
Medium Trust ASP.NET Applications


Rate this Content 2 Votes