AppDomain.ActivationContextはnullです
-
21-12-2019 - |
質問
私は私のアプリケーションにAppDomainを作成しました。以下は私が使用したコードです
AppDomainSetup domaininfo = new AppDomainSetup();
domaininfo.ApplicationBase = "C:\\";
AppDomain domain = AppDomain.CreateDomain("MyDomain", null, domaininfo);
ActivationContext context = domain.ActivationContext;
.
しかし、ActivationContext
は上記のスニペットのnull
です。誰もがこれを助けてくれることができます。事前にありがとうございます。
解決 2
ActivationContext
is byte array that contains the ClickOnce deployment manifest for the application that is associated with this ActivationContext
. It is used to get the ClickOnce deployment manifest for the current application.
if a ClickOnce application is running in the current AppDomain
by checking the AppDomain.CurrentDomain.ActivationContext
property. If that value is non-null, then the domain is running a ClickOnce application.
This can be examined by Checking the "Enable ClickOnce security settings" in Project Properties "Security" tab
In the correct context ClickOnce security settings is disabled. Because it is not a click once deployment. So the context also will be null by default
他のヒント
ActivationContext
を指定しない場合は、デフォルトでNULLです。
ActivationContext
が必要な場合は、AppDomainSetup
パラメータを受信するActivationContext
コンストラクタを使用します。
または一般的なCircumeTagcodeを採用したコンストラクター。