ASP.Net Medium trust and dll

北城余情 提交于 2019-12-25 03:37:04

问题


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.

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


回答1:


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

  • 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


来源:https://stackoverflow.com/questions/6875905/asp-net-medium-trust-and-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!