gpt4 book ai didi

c# - system.serviceModel 具有无效的子元素 domainServices

转载 作者:太空宇宙 更新时间:2023-11-03 11:23:11 24 4
gpt4 key购买 nike

我收到这个错误,但真的不知道如何解决:

The element 'system.serviceModel' has invalid child element 'domainServices'. List of possible elements expected: 'behaviors, bindings, client, comContracts, commonBehaviors, diagnostics, serviceHostingEnvironment, extensions, protocolMapping, services, standardEndpoints, tracking, routing

配置:

<?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>

最佳答案

有时,如果我们针对比预期版本更旧的 .Net Framework 版本,就会出现这种错误(“system.ServiceModel 具有无效的子元素 XXXX”)。这可以通过打开项目属性然后从应用程序选项卡修改目标框架来解决。希望这对外面的人有用。

关于c# - system.serviceModel 具有无效的子元素 domainServices,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10254839/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com