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&amp; 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&amp; result, Object&amp; 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[]&amp; outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; 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

时间: 2024-10-12 12:07:26

Request for the permission of type异常的相关文章

使用CGlib出现java.lang.NoClassDefFoundError: org/objectweb/asm/Type异常【补充】

援引:使用CGlib出现java.lang.NoClassDefFoundError: org/objectweb/asm/Type异常 援引:class net.sf.cglib.core.DebuggingClassWriter has interface org.objectweb.asm.ClassVisitor as super class 源环境: IDE:IntelliJ IDEA 项目目的:测试动态代理 -- CGLIB 项目属性:Java Application 项目结构: 被

FastJson格式化Request对象导致的一次异常思考

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 19.0px; font: 13.0px "Helvetica Neue"; color: #000000 } 一.问题描述: 近期,在环境中出现一个阻塞性的异常"nested exception is java.lang.IllegalStateException: It is illegal to call this method if the current req

Test is not an annotation type 异常

1. 异常如下: 今天遇到了这个错,也是郁闷了. 提示Test不是一个注释类型: 2. 异常分析: 刚开始以为自己把 Test 拼写错了: 后来以为版本有问题,所以又换成低版本的. 不行!!! 后来才发现,同包下有一个自定义的类,类名为 Test. 3. 解决方案 把同包下名为Test的类改名为Demo,OK.

org/objectweb/asm/Type异常解决办法

整合SSH的时候遇到了org/objectweb/asm/Type 解决方法1: 原因是Spring中的cglib-nodep-2.x.x.jar与Hibernate中的cglib-2.2.jar相冲突! 两种框架整合时Spring中的cglib-nodep-2.x.x.jar是必须的,取消Hibernate中的cglib-2.2.jar即可 解决方法2: 在Hibernate 3.2.6.中的 cglib 是 cglib-2.1.3.,jar 使用 cglib-2.2.jar 则出现以上问题.

.NET线程池

摘要 深度探索 Microsoft .NET提供的线程池, 揭示什么情况下你需要用线程池以及 .NET框架下的线程池是如何实现的,并告诉你如何去使用线程池. 内容 介绍 .NET中的线程池 线程池中执行的函数 使用定时器 同步对象的执行 异步I/O操作 监视线程池 死锁 有关安全性 结束 介绍 如 果你有在任何编程语言下的多线程编程经验的话,你肯定已经非常熟悉一些典型的范例.通常,多线程编程与基于用户界面的应用联系在一起,它们需要在不影响终 端用户的情况下,执行一些耗时的操作.取出任何一本参考书

.NET 线程池编程技术

摘要 深度探索 Microsoft .NET提供的线程池, 揭示什么情况下你需要用线程池以及 .NET框架下的线程池是如何实现的,并告诉你如何去使用线程池. 内容 介绍 .NET中的线程池 线程池中执行的函数 使用定时器 同步对象的执行 异步I/O操作 监视线程池 死锁 有关安全性 结束 介绍 如果你有在任何编程语言下的多线程编程经验的话,你肯定已经非常熟悉一些典型的范例.通常,多线程编程与基于用户界面的应用联系在一起,它们需要在不影响终端用户的情况下,执行一些耗时的操作.取出任何一本参考书,打

jmeter(十一)JDBC Request之Query Type

工作中遇到这样一个问题: 需要准备10W条测试数据,利用jmeter中的JDBC Request向数据库中批量插入这些数据(只要主键不重复就可以,利用函数助手中的Random将主键的ID末尾五位数随机插入), 响应数据报错:Can not issue data manipulation statements with executeQuery().后来查阅了很多资料,才发现跟JDBC Request中的Query Type类型选择有关: 最后得出的结论是:如果SQL语句是update.inser

Permission failure: android.permission.CAPTURE_AUDIO_OUTPUT 解决办法

在 android M 以上,MediaRecorder 录音时音源设置为 VOICE_CALL,开始录音时会抛出权限异常 12-04 10:34:41.808 545 2254 D AudioRecord: set(): 0xe90ba000, inputSource 4, sampleRate 44100, format 0x1, channelMask 0x10, frameCount 2048, notificationFrames 1024, sessionId 0, transfer

springcloud中servcie层调用fegin异常以及异步方法的实现

近日在做业务上的短信推送和APP消息推送,通过调用别的模块的接口来实现,在springcloud中通过fegin进行调用.这里要说明的事情并不是如何开发推送功能,而是在调试过程中碰到的一些小问题.我把消息推送之前的业务处理代码以及调用推送服务的代码都放在方法pushByAppAndShortMessage()中,然后把这个方法单独的放在crmservice里面.由于业务处理,pushByAppAndShortMessage中需要用到别的service,就不得不在crmservice中进行大量的a