Using Unity in Partial Trust Environments

patterns & practices Developer Center

Download codeDownload PDFOrder Paperback

This topic summarizes the restrictions on using Unity if you use Unity in a partial trust environment.

Unity Configuration

If your application runs under medium trust or uses the transparency model under full trust, you must add the requirePermission attribute with a value of false to the section element in your configuration file if you want to be able to read Unity configuration information from the configuration file. The following XML shows this setting:

<configuration>
  <configSections>
    <section name="unity" requirePermission="false" type=.../>
  </configSections>
  
  <unity xmlns="https://schemas.microsoft.com/practices/2010/unity">
    ...

  </unity>
  ...
</configuration>

Unity Interception

If your application runs under medium trust or uses the transparency model under full trust, you cannot use the Unity.Interception assembly. If you attempt to load this assembly, you will see a type load security exception.

Windows Store apps

Windows Store app scenarios are only supported with the Unity assembly. The Unity.Configuration and Unity.Interception assemblies are not supported because of security permissions constraints.

Next Topic | Previous Topic | Home | Community