Request for the permission of type异常
调用wcf调用的时候引发一个错误,错误信息如下:
<Message>Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.</Message>
<StackTrace> at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)</StackTrace>
<Type>System.Security.SecurityException</Type>
</InnerException>
<Message>Request for ConfigurationPermission failed while attempting to access configuration section 'dataConfiguration'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared.</Message>
<StackTrace> at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSourceImplementation.GetSection(String sectionName)
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetProviderMapping(String name, String dbProviderName)
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.PreBuildUp(IBuilderContext context)
at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)</StackTrace>
<Type>System.Security.SecurityException</Type>
</InnerException>
<Message>The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, MACProvider]) failed: Request for ConfigurationPermission failed while attempting to access configuration section 'dataConfiguration'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared. (Strategy type ConfiguredObjectStrategy, index 2)</Message>
<StackTrace> at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
at Microsoft.Practices.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator locator, ILifetimeContainer lifetime, IPolicyList policies, IStrategyChain strategies, Object buildKey, Object existing)
at Microsoft.Practices.ObjectBuilder2.Builder.BuildUp[TTypeToBuild](IReadWriteLocator locator, ILifetimeContainer lifetime, IPolicyList policies, IStrategyChain strategies, Object buildKey, Object existing)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, ILifetimeContainer lifetimeContainer, String id, IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](String id, IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.Create(String name)
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase(String name)
at ABC.AC.WebServices.FileTransport.BusinessLogicLayer.Impelementation.BaseBLLController.CreateDB(String dbName)
at ABC.AC.WebServices.FileTransport.BusinessLogicLayer.Impelementation.MACBLLController..ctor()
at ABC.AC.WebServices.FileTransport.ServiceLayer.FileTransportService.MTenantController..cctor() in F:\Loyalty\Phase3\WebServices\FileTransport\ServiceLayer\FileTransportService\Controller.cs:line 153</StackTrace>
<Type>Microsoft.Practices.ObjectBuilder2.BuildFailedException</Type>
</InnerException>
<Message>The type initializer for 'ABC.AC.WebServices.FileTransport.ServiceLayer.FileTransportService.MTenantController' threw an exception.</Message>
<StackTrace> at ABC.AC.WebServices.FileTransport.ServiceLayer.FileTransportService.MTenantController.SynchronizeLYBMerchant(String tenantCode, Nullable`1 lastSynchronizeTime)
at ABC.AC.WebServices.FileTransport.ServiceLayer.FileTransportService.CommonService.SynchronizeLYBMerchant(String tenantCode, Nullable`1 lastSynchronizeTime) in F:\Loyalty\Phase3\WebServices\FileTransport\ServiceLayer\FileTransportService\CommonService.cs:line 744
at ABC.AC.WebServices.FileTransport.ServiceLayer.FileTransportService.DataSynchronizService.GetMerchant(String tenantCode, Nullable`1 lastSynchronizeTime) in F:\Loyalty\Phase3\WebServices\FileTransport\ServiceLayer\FileTransportService\DataSynchronizeService.cs:line 25
at SyncInvokeGetMerchant(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>System.TypeInitializationException</Type>
主要原因是我从另外的机器复制了一份程序部署到这台机器上,在复制过来可能有些权限也跟着过来了。
解决方法设置
1:设置应用连接池的 process model的Identity. 缺省是ApplicationPoolIdentity。 修改为 Networkservice
转:
http://blogs.msdn.com/b/friis/archive/2010/06/09/system-security-securityexception-request-for-the-permission-of-type-system-web-aspnethostingpermission-failed.aspx
Request for the permission of type异常的更多相关文章
- thinkphp中 Illegal offset type异常
thinkphp中 Illegal offset type异常 一.错误提示 二.解决思路 1.看出错提示中的函数为assign函数,那说明是我们在从控制器assign数据到页面的部分出现了错误 2. ...
- 使用CGlib出现java.lang.NoClassDefFoundError: org/objectweb/asm/Type异常
在学习使用CGlib生成动态代理对象,项目的源代码也很简单: package proxy; import java.lang.reflect.Method; import net.sf.cglib.p ...
- FastJson格式化Request对象导致的一次异常思考
一.问题描述: 近期,在环境中出现一个阻塞性的异常“nested exception is java.lang.IllegalStateException: It is illegal to call ...
- org/objectweb/asm/Type异常解决办法
关于java.lang.NoClassDefFoundError: org/objectweb/asm/Type 调试SPRING MVC(或者整合SSH)的时候遇到了org/objectweb/as ...
- 关于struts2的checkboxlist、select等标签发生could not be resolved as a collection/array/map/enumeration/iterator type异常的记录
1 刚进入该界面的时候发生错误,原因是 list="roles"中的这个集合是空的,导致错误 解决办法很简单,不能让list为空 2 刚进入该界面的时候list是有数据的,当点击提 ...
- jsp 页面 javax.servlet.jsp.JspException cannot be resolved to a type 异常
<dependencies><dependency><groupId>javax.servlet</groupId><artifactId> ...
- 170524、java.lang.IllegalArgumentException: No converter found for return value of type异常解决
错误原因及解决步骤 1.原因:这是因为springmvc默认是没有对象转换成json的转换器的,需要手动添加jackson依赖. 2.解决步骤: 手动添加jackson依赖到pom.xml文件中 &l ...
- spring boot jpa-java.lang.IllegalArgumentException: Not a managed type异常问题解决方法
JPA实体类没有被扫描到,导致这样的情况有以下几种可能: 实体类没有加上@Entity注解 对应解决方法在实体类上加上@Entity即可解决问题 没有按照SpringBoot的约定,默认扫描(appl ...
- .NET 线程池编程技术
摘要 深度探索 Microsoft .NET提供的线程池, 揭示什么情况下你需要用线程池以及 .NET框架下的线程池是如何实现的,并告诉你如何去使用线程池. 内容 介绍 .NET中的线程池 线程池中执 ...
随机推荐
- Composite C1是一个.Net平台上开源专业的CMS开源项目
CompositeC1 4 发布 Composite C1是一个.Net平台上开源专业的CMS开源项目,很多的功能用户界面,面向任务的支持与各种工具协作.当编辑内容时在用户端体验很友好.编辑器与开发者 ...
- Centos 上使用mmsh协议听猫扑网络电台 VLC播放器
Centos 上使用mmsh协议听猫扑网络电台 VLC播放器 安装CentOS已经有一段时间了,但是由于在Linux下除了学习,其他是事情都干不了.今天想闲来无事开了CentOS就想听一下歌,突然想起 ...
- 如何优雅的设计Redux中的Store
用了几个月的redux,现在回过来总结一下. 刚开始用的时候遇到一个比较大的疑问,就是如何设计redux的store中的state树,这应该是我在使用redux中最大的一个疑问,阻挡了我前进的脚步,当 ...
- https时代来了,你却还一无所知?
本文作者:茄果,专注前端开发领域,更多文章请关注知乎专栏<前端小事> 现在打开各大知名网站,你有没有发现地址栏都已经加了个绿色的小锁? 是的,这就是https,这就是https的时代. 然 ...
- 【JS学习笔记】函数传参
比如仅仅改变背景的颜色 函数传参:参数就是占位符. 那么在什么时候用传参呢?函数里定不下来的东西. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1 ...
- Vmware(vmdk)虚拟机到hyperv(vhd)虚拟机转换
1.关闭Vmware所有虚拟机 2.合并Vmware磁盘 通常磁盘都分开储存 targetDisk.vmdk 3.转换vmdk到vhd 安装winimage http://www.winimage.c ...
- 关于mysql严格模式的开启、关闭
由于项目中对一些默认值设置问题,以及种种原因,mysql数据库需要使用非严格模式开发(mysql最近的版本默认是开启严格模式的). linux下mysql服务下操作步骤是: 1.进入mysql服务 ...
- mongodb tip-2
1.or 查询的格式: var condition = {$or:[{field:1},{field:2}]} 2.字符串存储日期也可以用$gt $gte $lt $lte 直接比较 var cond ...
- 【锋利的Jquery】读书笔记五
jquery表单 表格操作 表单从基本的得到和失去焦点表单验证 <script type="text/javascript"> $(function(){ $(&quo ...
- Discuz! X3.2重置管理员账号
主要是使用了Tools急诊箱.先看一下Tools急诊箱的主要功能: 多种模式在线安装Discuz!,或者重装 重置管理员账号:将把您指定的会员设置为管理员 关闭功能:一键关闭/打开 [站点|插件]的操 ...