调用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

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

  1. thinkphp中 Illegal offset type异常

    thinkphp中 Illegal offset type异常 一.错误提示 二.解决思路 1.看出错提示中的函数为assign函数,那说明是我们在从控制器assign数据到页面的部分出现了错误 2. ...

  2. 使用CGlib出现java.lang.NoClassDefFoundError: org/objectweb/asm/Type异常

    在学习使用CGlib生成动态代理对象,项目的源代码也很简单: package proxy; import java.lang.reflect.Method; import net.sf.cglib.p ...

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

    一.问题描述: 近期,在环境中出现一个阻塞性的异常“nested exception is java.lang.IllegalStateException: It is illegal to call ...

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

    关于java.lang.NoClassDefFoundError: org/objectweb/asm/Type 调试SPRING MVC(或者整合SSH)的时候遇到了org/objectweb/as ...

  5. 关于struts2的checkboxlist、select等标签发生could not be resolved as a collection/array/map/enumeration/iterator type异常的记录

    1 刚进入该界面的时候发生错误,原因是 list="roles"中的这个集合是空的,导致错误 解决办法很简单,不能让list为空 2 刚进入该界面的时候list是有数据的,当点击提 ...

  6. jsp 页面 javax.servlet.jsp.JspException cannot be resolved to a type 异常

    <dependencies><dependency><groupId>javax.servlet</groupId><artifactId> ...

  7. 170524、java.lang.IllegalArgumentException: No converter found for return value of type异常解决

    错误原因及解决步骤 1.原因:这是因为springmvc默认是没有对象转换成json的转换器的,需要手动添加jackson依赖. 2.解决步骤: 手动添加jackson依赖到pom.xml文件中 &l ...

  8. spring boot jpa-java.lang.IllegalArgumentException: Not a managed type异常问题解决方法

    JPA实体类没有被扫描到,导致这样的情况有以下几种可能: 实体类没有加上@Entity注解 对应解决方法在实体类上加上@Entity即可解决问题 没有按照SpringBoot的约定,默认扫描(appl ...

  9. .NET 线程池编程技术

    摘要 深度探索 Microsoft .NET提供的线程池, 揭示什么情况下你需要用线程池以及 .NET框架下的线程池是如何实现的,并告诉你如何去使用线程池. 内容 介绍 .NET中的线程池 线程池中执 ...

随机推荐

  1. 实现了一个简单的key-value存储系统

    实现了一个简单的key-value存储系统 源码下载: kvfs.rar 正文: 所谓的Key-Value就是每次存储一个数据时,是根据Key进行索引存储的.为了实现Key的快速查找功能,我使用了B- ...

  2. MingQQ v1.0高仿版开源了,使用WebQQ协议实现了QQ客户端基本的聊天功能...

    MingQQ v1.0高仿版开源了,使用WebQQ协议实现了QQ客户端基本的聊天功能... MingQQ目前支持的功能如下:1.支持普通方式登录.验证码方式登录.注销.保持在线.改变在线状态.2.支持 ...

  3. 【Linux】Shell学习笔记之四——文件和目录管理(硬连接和软连接)

    在这节将要学习linux的连接档,在之前用"ls -l" 查看文件属性的命令时, 其中第二个属性是连接数.那么这个连接数是干什么的?这就要理解inode. 先说一下文件是怎么存储的 ...

  4. iOS学习笔记(十六)——数据库操作(使用FMDB)

    iOS中原生的SQLite API在使用上相当不友好,在使用时,非常不便.于是,就出现了一系列将SQLite API进行封装的库,例如FMDB.PlausibleDatabase.sqlitepers ...

  5. Linux系统 nfs 共享及 挂载mount 配置

    要把 A服务器(192.168.1.1)的 /home 目录挂载到 B服务器(192.168.1.2)的/mnt目录 我们先在 A 服务器上编辑/etc/exports 文件, 添加下面这行代码 /h ...

  6. sharepoint 2013 文档库eventhandle权限控制

    记录一下如何在sharepoint server 2013文档库中,使用eventhandle控制文档库document library的条目item权限. ///<summary> // ...

  7. gearman的安装和配置

    gearman作为并发任务管理服务,已经越来越多攻城狮在生产环境中使用了.为了日后方便部署到服务器,我写了一个shell. 一般服务器使用稳定的centos,我使用的是centos6.7. 安装she ...

  8. dll导出命名空间下的c风格函数陷阱

    1.编译阶段,如果不是重载,那么C风格的同名函数与C++风格的同名函数,就会报编译错误.error C2084: function 'int Test(void)' already has a bod ...

  9. message from server: "Host 'xxx' is not allowed to connect to this MySQL server的解决

    解决方法:    1. 改表法.    可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" ...

  10. java 报表到excel

    现加个jar包 http://pan.baidu.com/s/1boe5kXh   vfp8 然后代码 package makeReportToExcel; import java.io.File; ...