ActivationArguments クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public NotInheritable Class ActivationArguments

ActivationArguments クラスは、AppDomainSetup クラスによって使用されます。
マニフェストに基づくアクティベーション モデルでは、アクティベーション用のアセンブリではなく、アプリケーション マニフェストを使用します。マニフェストで、アプリケーション、アプリケーションの依存関係、セキュリティ要件などを完全に記述します。マニフェスト モデルには、特に Web アプリケーションの場合に、アセンブリに基づくアクティベーション モデルより優れたいくつかのメリットがあります。たとえば、マニフェストには、アプリケーションのセキュリティ要件が格納されますが、これにより、コードをダウンロードする前にアプリケーションを実行できるようにするかどうかをユーザーが決定できます。マニフェストには、アプリケーションの依存関係に関する情報も格納されます。

マニフェストに基づくアプリケーションの AppDomain の AppDomainSetup から、現在の ActivationArguments オブジェクトを取得する方法を次のコード例に示します。
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) '<Snippet2 ' 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
using System; using System.Collections; using System.Text; using System.Security.Policy; using System.Reflection; using System.Security; using System.Security.Permissions; using System.Runtime.Hosting; namespace ActivationContextSample { public class Program : MarshalByRefObject { [SecurityPermission(SecurityAction.LinkDemand, ControlDomainPolicy=true)] public static void Main(string[] args) { // Get the AppDomainManager from the current domain. AppDomainManager domainMgr = AppDomain.CurrentDomain.DomainManager; // Get the ApplicationActivator from the AppDomainManager. ApplicationActivator appActivator = domainMgr.ApplicationActivator; Console.WriteLine("Assembly qualified name from the application activator."); Console.WriteLine(appActivator.GetType().AssemblyQualifiedName); // Get the ActivationArguments from the SetupInformation property of the domain. ActivationArguments activationArgs = AppDomain.CurrentDomain.SetupInformation.ActivationArguments; // Get the ActivationContext from the ActivationArguments. ActivationContext actContext = activationArgs.ActivationContext; Console.WriteLine("The ActivationContext.Form property value is: " + activationArgs.ActivationContext.Form); Console.Read(); } [SecurityPermission(SecurityAction.LinkDemand, ControlDomainPolicy=true)] public void Run() { Main(new string[] { }); Console.ReadLine(); } } }

System.Runtime.Hosting.ActivationArguments


Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ActivationArguments クラスのページへのリンク