Automapper中等信任问题。无法解决它

时间:2011-06-14 05:33:41

标签: asp.net-mvc-3 automapper

由于automapper中等信任,我部署了我的网站并收到错误。

任何解决方案?

[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
   System.Security.CodeAccessPermission.Demand() +46
   System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner, StackCrawlMark& stackMark, Boolean skipVisibility) +9461551
   System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility) +40
   AutoMapper.DelegateFactory.CreateDynamicMethod(MemberInfo member, Type sourceType) +585
   AutoMapper.DelegateFactory.CreateSet(PropertyInfo property) +128
   AutoMapper.Internal.PropertyAccessor..ctor(PropertyInfo propertyInfo) +122
   AutoMapper.ReflectionHelper.ToMemberAccessor(MemberInfo accessorCandidate) +294
   AutoMapper.TypeMapFactory.CreateTypeMap(Type sourceType, Type destinationType, IMappingOptions options) +521
   AutoMapper.Configuration.CreateTypeMap(Type source, Type destination, String profileName) +156
   AutoMapper.Configuration.CreateMap(String profileName) +179
   AutoMapper.Configuration.CreateMap() +92
   AutoMapper.Mapper.CreateMap() +98

1 个答案:

答案 0 :(得分:0)

这里有一个有根据的猜测...但你是在托管环境中运行,你的应用程序运行在中等而不完全信任?如果是这样,由于反射发射代码,您将需要尝试授予您的程序集完全信任。