首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >system.serviceModel有无效的子元素domainServices

system.serviceModel有无效的子元素domainServices
EN

Stack Overflow用户
提问于 2012-04-20 23:33:07
回答 1查看 2.4K关注 0票数 2

我得到了这个错误,并且真的不知道如何修复它:

元素'system.serviceModel‘有无效的子元素'domainServices’。期望的可能元素列表:‘行为、绑定、客户端、comContracts、commonBehaviors、诊断、serviceHostingEnvironment、扩展、protocolMapping、服务、standardEndpoints、跟踪、路由

配置:

代码语言:javascript
复制
<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="system.serviceModel">
      <section name="domainServices" type="System.ServiceModel.DomainServices.Hosting.DomainServicesSection, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" allowDefinition="MachineToApplication" requirePermission="false" />
    </sectionGroup>
  </configSections>    
  <system.serviceModel>
    <domainServices>
      <endpoints>
        <!-- <add name="OData" type="System.ServiceModel.DomainServices.Hosting.ODataEndpointFactory, System.ServiceModel.DomainServices.Hosting.OData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> -->
        <add name="soap" type="Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <!-- <add name="JSON" type="Microsoft.ServiceModel.DomainServices.Hosting.JsonEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> -->
      </endpoints>
    </domainServices>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceThrottling  maxConcurrentCalls="100"  maxConcurrentSessions="100"  maxConcurrentInstances="10"  />
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
 </configuration>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-04-22 03:57:39

有时,如果我们针对比预期更早的.Net框架版本,可能会出现这种错误(“.Net有一个无效的子元素XXXX")。可以通过打开Properties,然后从Application选项卡修改目标框架来解决这个问题。希望这对外面的人有用。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10254839

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档