【问题标题】:What's the easiest way to determine if a method call will run under Medium Trust?确定方法调用是否会在中等信任下运行的最简单方法是什么?
【发布时间】:2010-03-02 18:09:50
【问题描述】:

有没有一种快速的方法来确定方法调用是否会在中等信任下运行?在这种情况下,我特别想了解 .NET Framework 方法的信任级别要求。谢谢!

【问题讨论】:

    标签: asp.net security


    【解决方案1】:

    查看MSDN或使用Reflector查看属性。

    这只是您要查找的属性类型的一个示例。

    [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public static class ProfileManager
    {
    

    【讨论】:

      【解决方案2】:

      您需要在 web.config 文件中设置信任级别介质

      【讨论】:

      • @adeel,这如何确定一个方法/类是否会在中等信任下运行?
      猜你喜欢
      • 1970-01-01
      • 2017-05-01
      • 2010-11-06
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 2011-01-02
      • 2013-08-22
      • 2020-10-29
      相关资源
      最近更新 更多