NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

AppDomain.DefineDynamicAssembly (AssemblyName, AssemblyBuilderAccess, String, Evidence)

Defines a dynamic assembly with the given name, given access, the name of the directory for saving the assembly, and the supplied evidence.

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 _
) As AssemblyBuilder
[C#]
public AssemblyBuilder DefineDynamicAssembly(
   AssemblyName name,
   AssemblyBuilderAccess access,
   string dir,
   Evidence evidence
);
[C++]
public: AssemblyBuilder* DefineDynamicAssembly(
   AssemblyName* name,
   AssemblyBuilderAccess access,
   String* dir,
   Evidence* evidence
);
[JScript]
public function DefineDynamicAssembly(
   name : AssemblyName,
   access : AssemblyBuilderAccess,
   dir : String,
   evidence : Evidence
) : AssemblyBuilder;

Parameters

name
The unique identity of the dynamic assembly.
access
The mode in which the dynamic assembly will be accessed.
dir
The name of the directory in which the assembly will be saved. If dir is a null reference (Nothing), the directory defaults to the current directory.
evidence
The evidence supplied for the dynamic assembly.

Return Value

An AssemblyBuilder object that represents the dynamic assembly created.

Exceptions

Exception Type Condition
ArgumentNullException is thrown if name is a null reference (Nothing).

Remarks

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.

See Also

AppDomain Class | AppDomain Members | System Namespace | AppDomain.DefineDynamicAssembly Overload List