ASP.Net中等信任度和dll [英] ASP.Net Medium trust and dll

查看:76
本文介绍了ASP.Net中等信任度和dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.Net网站,并添加了对我的dll的引用.为网站设置了中等信任权限级别. 在网站编译期间,出现异常:

I have an ASP.Net website and add a reference to my dll. Medium trust permission level is set for the web site. During web site compilation i get the exception:

无法加载文件或程序集...或其依赖项之一.无法授予最低权限请求.

Could not load file or assembly ... or one of its dependencies. Failed to grant minimum permission requests.

我应该在dll中进行哪些更改,以使其在中等信任级别下工作?

What should i change in my dll to make it work in Medium trust level ?

推荐答案

这取决于您的DLL在做什么.以下是中等信任"下应用的一些限制:

It depends on what your DLL is doing. Here are some of the restrictions applied under Medium Trust:

  • 权限受到应用程序自身访问权限的限制 目录结构
  • 不允许访问文件 在应用程序的虚拟目录层次结构之外
  • 有限 某些常见环境变量的权利
  • 无反省 权限
  • 无套接字权限
  • 要访问Web资源, 您必须在originUrl中显式添加终结点"URL" 元素的属性或策略文件中的内容
  • Permissions are limited in what the application can access within its own directory structure
  • No file access is permitted outside of the application's virtual directory hierarchy
  • Limited rights to certain common environment variables
  • No reflection permissions
  • No sockets permission
  • To access Web resources, you must explicitly add endpoint 'URLs' - either in the originUrl attribute of the element or inside the policy file

这篇关于ASP.Net中等信任度和dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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