NHibernate在部署的Web应用程序上出现“安全”问题

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

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

exception详细信息:System.Security.SecurityException:请求类型’System.Configuration.ConfigurationPermission,System.Configuration,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = tokenkeyhere’失败的权限。

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

我们最近一直在关注这个问题。 这是一个关于在中等信任中运行NHibernate的链接

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

来自文章:

- 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. ie 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. ie calls to a database, network, etc. - Minimal trust – code is restricted from anything but the most trival processing (calculating algorithms).