HostSecurityPolicyResults 枚举


指定要应用于程序集的安全策略的类型。Specifies the type of security policy to apply to an assembly.

public enum class HostSecurityPolicyResults
public enum HostSecurityPolicyResults
type HostSecurityPolicyResults = 
Public Enum HostSecurityPolicyResults


AppDomainTrust 2

指示应将与 AppDomain 实例关联的权限集应用于指定程序集。Indicates that the permission set that is associated with the AppDomain instance should be applied to the specified assembly. 这意味着,应将程序集视为加载到部分信任 ASP.NET AppDomain 实例中的用户程序集。This means that the assembly should be treated as a user assembly that is loaded into the partial-trust ASP.NET AppDomain instance. 此外,程序集应具有在初始化时指派给 AppDomain 实例的权限集。In addition, the assembly should have the permission set that was assigned to the AppDomain instance at initialization.

DefaultPolicy 0

指示 ASP.NET 应使用默认逻辑来确定指定程序集的适当权限集。Indicates that ASP.NET should use default logic to determine the appropriate permissions set for the specified assembly. 如果您不希望确定程序集的权限集,则应返回 DefaultPolicy 值。You should return the DefaultPolicy value if you do not you want to decide the permission set for the assembly.

FullTrust 1

指示应向指定程序集授予完全信任。Indicates that the specified assembly should be granted full trust.

Nothing 3

指示指定程序集的权限集设置为空。Indicates that the permission set for the specified assembly is set to empty. 空权限集是将参数值 PermissionSet 传递给构造函数后所产生的 None 类的新实例。An empty permission set is a new instance of the PermissionSet class, with a parameter value of None passed to the constructor. ASP.NET 部分信任应用程序域中将不能加载与空权限集关联的程序集。An assembly that is associated with an empty permission set will not load in an ASP.NET partial trust application domain. 因此,可使用 Nothing 字段防止程序集加载到部分信任的 ASP.NET 应用程序域中。Therefore, you can use the Nothing field to prevent an assembly from loading into a partial trust ASP.NET application domain.


类用于提供ResolvePolicy方法的返回值。 HostSecurityPolicyResultsThe HostSecurityPolicyResults class is used to supply the return value for the ResolvePolicy method. 如果要自定义 ASP.NET 运行时行为以替代 ASP.NET 代码访问安全策略, 请使用此方法。Use this method if you want to customize ASP.NET run-time behavior to override the ASP.NET code access security policy. 方法返回的枚举值指示要使用的安全策略的类型。The enumeration value that is returned by the method indicates the type of security policy to use.