0

我在我的本地机器(32 位机器)上托管 Wcf 应用程序。我遇到了错误。

Config Error    This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false". 

附加相同的配置文件详细信息。

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="WcfServiceDemo.ServiceCalculateCost" >
        <endpoint address="" binding="wsHttpBinding" contract="WcfServiceDemo.IServiceCalculateCost"></endpoint> 

      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>

          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>
4

1 回答 1

0

IIS 7 实现了“配置锁定”。这是为了帮助 IIS 管理。

在这里,查看错误详细信息以及如何解决:IIS 7 - 此配置部分不能在此路径中使用。

根据它,决议之一:

  1. 打开applicationHost.config位于此处的文件:%windir%\system32\inetsrv\config\applicationHost.config

  2. 编辑“ handlers”部分。

  3. 更改此行:

    <section name=”handlers” overrideModeDefault=”Deny” />

    至:

    <section name=”handlers” overrideModeDefault=”Allow” />

于 2013-10-04T10:21:46.883 回答