程序集不允许部分受信任的调用者

编程入门 行业动态 更新时间:2024-10-25 08:16:54
本文介绍了程序集不允许部分受信任的调用者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何更改我的库以允许部分受信任的呼叫者?

How do I change my library to allow partially trusted callers?

我收到以下错误:

/"应用程序中的服务器错误.

Server Error in '/' Application.

安全异常

描述:应用程序尝试执行不允许的操作安全政策.授予这个申请所需的权限请联系您的系统管理员或更改应用程序的信任级别配置文件.

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.

异常详情:System.Security.SecurityException:该程序集不允许部分值得信赖的来电者.

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

来源错误:[无相关来源行]

Source Error: [No relevant source lines]

源文件:App_Web_kzj7vfkn.2.cs行:0

Source File: App_Web_kzj7vfkn.2.cs Line: 0

编辑

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

Edit

After some more looking at the problem it seems like it's System.Web.UI.ClientScriptManager that causes the problem

推荐答案

假设您可以访问库的源.

Assuming you have access to the sources of your library.

  • 为您尝试调用的库提供强名称.
  • 将 [assembly:AllowPartiallyTrustedCallers] 添加到你正在尝试的图书馆称呼.
  • 创建代码组以设置对库的权限
  • Give the library you are trying to call a strong name.
  • Add [assembly:AllowPartiallyTrustedCallers] to the library that you are trying to call.
  • Create a code group to set permissions to the library

在此处给出了非常好的详细解释,同时阅读底部的链接以获取更好的理解.

A pretty good and detailed explanation is given here Also read the links at the bottom to get a better understanding.

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

There is a possibility that not your assembly is the problem but you are calling another assembly that does not allow partially trusted callers. At runtime you can use fuslogvw to find which assembly is giving you the problems. If this is the problem and you have the sources of this assembly you need to also apply the [assembly:AllowPartiallyTrustedCallers] attribute to that assembly, if you don't have the sources the only option I know of is to replace the troublesome library.

更多推荐

程序集不允许部分受信任的调用者

本文发布于:2023-11-05 08:37:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560380.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不允许   程序   调用者

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!