首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >(Fluent) NHibernate安全异常- ReflectionPermission

(Fluent) NHibernate安全异常- ReflectionPermission
EN

Stack Overflow用户
提问于 2010-04-11 19:29:54
回答 1查看 1.2K关注 0票数 2

我已经将一个ASP.Net Web应用程序升级到最新版本的Fluent NHibernate (1.0.0.636)和最新版本的NHibernate (v2.1.2.4000)。我已经检查了几次,确认应用程序是在完全信任下运行的。但我一直收到以下错误:

代码语言:javascript
复制
Security Exception
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.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessPermission.Demand() +54
   System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner, StackCrawlMark& stackMark, Boolean skipVisibility) +269
   System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility) +81
   NHibernate.Bytecode.Lightweight.ReflectionOptimizer.CreateDynamicMethod(Type returnType, Type[] argumentTypes) +165
   NHibernate.Bytecode.Lightweight.ReflectionOptimizer.GenerateGetPropertyValuesMethod(IGetter[] getters) +383
   NHibernate.Bytecode.Lightweight.ReflectionOptimizer..ctor(Type mappedType, IGetter[] getters, ISetter[] setters) +108
   NHibernate.Bytecode.Lightweight.BytecodeProviderImpl.GetReflectionOptimizer(Type mappedClass, IGetter[] getters, ISetter[] setters) +52
   NHibernate.Tuple.Component.PocoComponentTuplizer..ctor(Component component) +231
   NHibernate.Tuple.Component.ComponentEntityModeToTuplizerMapping..ctor(Component component) +420
   NHibernate.Tuple.Component.ComponentMetamodel..ctor(Component component) +402
   NHibernate.Mapping.Component.BuildType() +38
   NHibernate.Mapping.Component.get_Type() +32
   NHibernate.Mapping.SimpleValue.IsValid(IMapping mapping) +39
   NHibernate.Mapping.RootClass.Validate(IMapping mapping) +61
   NHibernate.Cfg.Configuration.ValidateEntities() +220
   NHibernate.Cfg.Configuration.Validate() +16
   NHibernate.Cfg.Configuration.BuildSessionFactory() +39
   FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs:93

有谁有过类似的错误吗?我已经搜索了web / stackoverflow / NHibernate论坛,但只发现在中等信任模式下运行时有问题的人,而不是完全信任的人。我已经在这台机器上使用以前版本的Fluent NHibernate和NHibernate在这个应用程序上开发了几个月。

我正在运行的机器是64位的,你永远不会知道这是不是相关的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-04-11 19:44:04

当你第一次下载一个新的DLL时,你可能会遇到这个问题,这可能不是你的问题(任何使它不可信的事情都会导致相同的错误),但是,它不止一次地给我造成了完全相同的错误。下面是如何让它像应用程序的其余部分一样以完全信任的方式运行:

click of the >右键单击新的常规DLL(可能需要一次1次执行此操作,而不是位于常规DLL选项卡的最底部),您可能会看到一条消息:"This

  • computer".

  • Click
  • nHibernate sure)
  • Properties
  • At

“(此文件来自另一台计算机,可能已被阻止,以帮助保护该DLL旁边的此DLL

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2616843

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档