AppDomain.ActivationContext为NULL [英] AppDomain.ActivationContext is NULL

查看:158
本文介绍了AppDomain.ActivationContext为NULL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用程序中创建了一个AppDomain.以下是我使用的代码

I have created an AppDomain in my application. Below is the code I have used

AppDomainSetup domaininfo = new AppDomainSetup();
domaininfo.ApplicationBase = "C:\\";
AppDomain domain = AppDomain.CreateDomain("MyDomain", null, domaininfo);
ActivationContext context = domain.ActivationContext;

但是上面片段中的ActivationContextnull.谁可以帮我这个事.预先感谢.

But the ActivationContext is null in above snippet. Can anyone help me on this. Thanks in Advance.

推荐答案

ActivationContext是字节数组,其中包含与此ActivationContext关联的应用程序的ClickOnce部署清单.它用于获取当前应用程序的ClickOnce部署清单.

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.

如果通过检查AppDomain.CurrentDomain.ActivationContext属性在当前AppDomain中正在运行ClickOnce应用程序.如果该值不为null,则说明该域正在运行ClickOnce应用程序.

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.

可以通过在项目属性"的安全性"选项卡中选中启用ClickOnce安全性设置"来进行检查

This can be examined by Checking the "Enable ClickOnce security settings" in Project Properties "Security" tab

在正确的上下文中,已禁用ClickOnce安全设置.因为它不是一次单击部署.因此上下文默认情况下也将为空

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

这篇关于AppDomain.ActivationContext为NULL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆