ActivationArguments Class
Assembly: mscorlib (in mscorlib.dll)
'Declaration <SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public NotInheritable Class ActivationArguments 'Usage Dim instance As ActivationArguments
/** @attribute SerializableAttribute() */ /** @attribute ComVisibleAttribute(true) */ public final class ActivationArguments
SerializableAttribute ComVisibleAttribute(true) public final class ActivationArguments
Not applicable.
The ActivationArguments class is used by the AppDomainSetup class.
The manifest-based activation model uses an application manifest rather than an assembly for activation. A manifest fully describes the application, its dependencies, security requirements, and so forth. The manifest model has several advantages over the assembly-based activation model, especially for Web applications. For example, the manifest contains the security requirements of the application, which enables the user to decide whether to allow the application to execute before downloading the code. The manifest also contains information about the application dependencies.
The following code example shows how to obtain the current ActivationArguments object from the AppDomainSetup for the AppDomain of a manifest-based application.
Imports System Imports System.Collections Imports System.Text Imports System.Security.Policy Imports System.Reflection Imports System.Security Imports System.Security.Permissions Imports System.Runtime.Hosting Public Class Program Inherits MarshalByRefObject <SecurityPermission(SecurityAction.LinkDemand, ControlDomainPolicy:=True)> _ Public Shared Sub Main(ByVal args() As String) ' Get the AppDomainManager from the current domain. Dim domainMgr As AppDomainManager = AppDomain.CurrentDomain.DomainManager ' Get the ApplicationActivator from the AppDomainManager. Dim appActivator As ApplicationActivator = domainMgr.ApplicationActivator Console.WriteLine("Assembly qualified name from the application activator.") Console.WriteLine(appActivator.GetType().AssemblyQualifiedName) Dim ac As ActivationContext = AppDomain.CurrentDomain.ActivationContext ' Get the ActivationArguments from the SetupInformation property of the domain. Dim activationArgs As ActivationArguments = AppDomain.CurrentDomain.SetupInformation.ActivationArguments ' Get the ActivationContext from the ActivationArguments. Dim actContext As ActivationContext = activationArgs.ActivationContext Console.WriteLine("The ActivationContext.Form property value is: " + _ activationArgs.ActivationContext.Form.ToString()) Console.Read() End Sub 'Main <SecurityPermission(SecurityAction.LinkDemand, ControlDomainPolicy:=True)> _ Public Sub Run() Main(New String() {}) Console.ReadLine() End Sub 'Run End Class 'Program
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.