【问题标题】:Security Exception on WindowsIdentity.GetCurrent()WindowsIdentity.GetCurrent() 上的安全异常
【发布时间】:2009-05-27 20:26:35
【问题描述】:

单击一次部署。

应用程序在 VS2008 中运行良好。

在运行已部署的应用程序时抛出异常:WindowsIdentity.GetCurrent()

请求“System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”类型的权限失败。

单击一次安全设置:完全信任应用程序。

有什么想法吗?

谢谢, 血压

【问题讨论】:

    标签: .net security clickonce windows-identity


    【解决方案1】:

    一种方法是指定每个最终用户都必须具有允许 SecurityPermissionFlag.ControlPrincipal 的部署区域策略。

    另一种方法是在部署期间为您的应用程序请求此特定权限。如果最终用户同意,将授予权限。

    或者,您可以在部署期间全力以赴并为您的应用程序请求 FullTrust。

    【讨论】:

    • 你的答案比我的好,所以我删除了我的答案,将其内容添加到你的答案中,然后给你点赞:-)
    猜你喜欢
    • 1970-01-01
    • 2016-06-16
    • 1970-01-01
    • 2017-04-20
    • 2017-03-01
    • 2012-02-25
    • 1970-01-01
    • 1970-01-01
    • 2010-12-02
    相关资源
    最近更新 更多