Defines a dynamic assembly with the given name, given access, the name of the directory for saving the assembly, supplied evidence, and the permission requests.
Only fully trusted callers can supply their evidence when defining a dynamic assembly. The runtime will map the evidence through policy to determine the granted permissions. Semi-trusted callers must supply a a null reference (in Visual Basic Nothing) evidence. If evidence is a null reference (Nothing), the runtime copies the permission sets, i.e., the current grant and deny sets, from the caller's assembly to the dynamic assembly being defined and marks policy as resolved.
If the dynamic assembly is saved to disk, subsequent loads will get grants based on policies associated with the location where the assembly was saved.
[Visual Basic] Overloads Public Function DefineDynamicAssembly( _ ByVal name As AssemblyName, _ ByVal access As AssemblyBuilderAccess, _ ByVal dir As String, _ ByVal evidence As Evidence, _ ByVal requiredPermissions As PermissionSet, _ ByVal optionalPermissions As PermissionSet, _ ByVal refusedPermissions As PermissionSet _ ) As AssemblyBuilder [C#] public AssemblyBuilder DefineDynamicAssembly( AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions ); [C++] public: AssemblyBuilder* DefineDynamicAssembly( AssemblyName* name, AssemblyBuilderAccess access, String* dir, Evidence* evidence, PermissionSet* requiredPermissions, PermissionSet* optionalPermissions, PermissionSet* refusedPermissions ); [JScript] public function DefineDynamicAssembly( name : AssemblyName, access : AssemblyBuilderAccess, dir : String, evidence : Evidence, requiredPermissions : PermissionSet, optionalPermissions : PermissionSet, refusedPermissions : PermissionSet ) : AssemblyBuilder;
An AssemblyBuilder object that represents the dynamic assembly created.
Exception Type | Condition |
---|---|
ArgumentNullException | is thrown if name is a null reference (Nothing). |
You can specify partial signing of the assembly by specifing AssemblyName.Originator. You can specify full signing of the assembly by specifying AssemblyName.Originator and AssemblyName.KeyPair.
AppDomain Class | AppDomain Members | System Namespace | AppDomain.DefineDynamicAssembly Overload List