您的位置:首页 > 其它

webconfig文件serviceHostingEnvironment节点出错的解决方法

2015-10-29 11:20 423 查看
在三点五和二版本的配置中可以出现这个节点,但是在4.0是没有的,所以如果框架是4.0的时候要除去这个节点,不然就会报以下错误:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 180: </runtime>
Line 181: <system.serviceModel>
Line 182: <serviceHostingEnvironment aspNetCompatibilityEnabled="false"/>
Line 183: <behaviors>
Line 184: <endpointBehaviors>

这个节点的作用如MSDN介绍的一样。是

一个布尔值,指示是否已为当前应用程序启用了 ASP.NET 兼容模式。默认值为 false

当此属性设置为 true 时,对 Windows Communication Foundation (WCF) 服务的请求将流经 ASP.NET HTTP 管道,而通过非 HTTP 协议的通信将被禁止。有关更多信息,请参见WCF Services and ASP.NET

他的作用简而言之就是WCF程序访问session时候才用得到
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: