gpt4 book ai didi

c# - 程序集不允许部分信任的调用者

转载 作者:可可西里 更新时间:2023-11-01 03:14:36 24 4
gpt4 key购买 nike

如何更改我的库以允许部分信任的调用者?

我收到以下错误:

Server Error in '/' Application.

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.

Source Error: [No relevant source lines]

Source File: App_Web_kzj7vfkn.2.cs
Line: 0

编辑

在进一步查看问题后,似乎是 System.Web.UI.ClientScriptManager 导致了问题

最佳答案

假设您可以访问图书馆的资源。

给出了非常好的和详细的解释here另请阅读底部的链接以更好地理解。

有可能不是您的程序集有问题,而是您正在调用另一个不允许部分信任的调用方的程序集。在运行时你可以使用 fuslogvw找出哪个程序集给你带来了问题。如果这是问题所在并且您有此程序集的源代码,则还需要应用 [assembly:AllowPartiallyTrustedCallers]属性到该程序集,如果您没有源代码,我知道的唯一选择是替换麻烦的库。

关于c# - 程序集不允许部分信任的调用者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3487001/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com