大会不允许部分受信任的调用者 [英] Assembly does not allow partially trusted caller

查看:214
本文介绍了大会不允许部分受信任的调用者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改我的图书馆允许部分信任的调用方?

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

我收到以下错误:

中的服务器错误

安全例外

说明:应用程序试图
,来执行操作不是由$允许b $ b中的安全策略。要授予此
应用程序所需的权限,
,请联系您的系统
管理员或改变
的配置文件中的
应用程序的信任级别。

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

在多一些看问题好像它是系统.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.

  • 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 找到该组件给你问题。如果是这样的问题,你有这个大会的来源,你还需要应用 [组装: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.

这篇关于大会不允许部分受信任的调用者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆