2.2.4.2.2.3.2 ClrAssembly

The ClrAssembly complex type represents a common language runtime (CLR) assembly. CLR assemblies treat ImpersonationMode=Default as ImpersonateServiceAccount for the Safe permission set and ImpersonateCurrentUser for the ExternalAccess and Unrestricted permission sets. CLR assemblies support all impersonation modes.

ClrAssembly is derived from Assembly.

   <xsd:complexType name="ClrAssembly">
     <xsd:complexContent>
       <xsd:extension base="Assembly" >
         <xsd:sequence>
           <xsd:element name="Files" >
             <xsd:complexType>
               <xsd:sequence>
                 <xsd:element name="File"  type="ClrAssemblyFile" 
                              maxOccurs="unbounded" />
               </xsd:sequence>
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="PermissionSet" minOccurs="0">
             <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                 <xsd:enumeration value="Safe"/>
                 <xsd:enumeration value="ExternalAccess"/>
                 <xsd:enumeration value="Unrestricted"/>
               </xsd:restriction>
             </xsd:simpleType>
           </xsd:element>
         </xsd:sequence>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>

The following table describes the elements that are included in the XSD schema for ClrAssembly. Also included in ClrAssembly are all the elements from Assembly, as described in section 2.2.4.2.2.3.

Element

Read-Only

Default value

Description

Files

[Required]

A collection of file elements, each of which includes the contents of an Assembly file. At least one file in the collection of files MUST have a Type element that has a value of "Main".

PermissionSet

"Safe"

The access permission level that the server will apply to this Assembly object.

The enumeration values are as follows:

  • Safe - Only internal computation and local data access is allowed. Safe is the most restrictive permission set. Code executed by an assembly with Safe permissions cannot access external system resources, such as files, network, environment variables, or the registry.

  • ExternalAccess - Safe, with the additional ability to access external system resources, such as files, networks, environmental variables, and the registry.

  • Unrestricted – Allows assemblies unrestricted access to resources, both inside and outside the server. Code that executes from within an unrestricted assembly can call unmanaged code.