gpt4 book ai didi

c# - "Security"部署的 Web 应用程序上的 NHibernate 问题

转载 作者:行者123 更新时间:2023-11-30 16:31:38 25 4
gpt4 key购买 nike

我已经在服务器上部署了一个使用 NHibernate 的 Web 应用程序。该应用程序在我的本地开发机器上编译和运行良好,但新服务器上的 NHibernate 存在问题。我收到以下错误:

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: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=tokenkeyhere' failed.

它建议在配置文件中更改应用程序的“信任级别”。我到底该怎么做?这是我第一次部署 NHibernate 网络应用程序,所以我不知所措。

最佳答案

我们最近一直在关注这个问题。这是 running NHibernate in medium trust 上的链接

这是我见过的关于不同信任级别的最简洁的解释:Trust Levels Demystified

来自文章:

- Full trust – your code can do anything that the account running it can do.
- High trust – same as above except your code cannot call into unmanaged code. i.e. Win32 APIs, COM interop.
- Medium trust – same as above except your code cannot see any part of the file system except its application directory.
- Low trust – same as above except your code cannot make any out-of-process calls. i.e. calls to a database, network, etc.
- Minimal trust – code is restricted from anything but the most trival processing (calculating algorithms).

关于c# - "Security"部署的 Web 应用程序上的 NHibernate 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4765473/

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