0

ServiceActivationException:服务'//Service.svc'由于编译过程中的异常而无法激活。异常消息是:未提供服务的基地址。提供至少一个基地址。

我在 web.config 中提供了基地址

<system.serviceModel>
<services>
  <service name="WFService.Service1" behaviorConfiguration="WFService.Service1Behavior">
    <endpoint name="json" address="http://localhost:3003/WFServiceHost/Service.svc/json" binding="webHttpBinding" bindingConfiguration="webHttpBindingConfig" contract="WFService.IService" behaviorConfiguration="WFServiceJsonEndpointBehavior"/>
    <host>
      **<baseAddresses>
        <add baseAddress="http://localhost:3003/WFServiceHost/Service.svc"/>
      </baseAddresses>**
    </host>
  </service>
</services>

在 service.svc - 我有 Factory="System.ServiceModel.Activation.WorkflowServiceHostFactory"

任何想法,它的解决方案是什么?

4

1 回答 1

1

baseAddress 不应包含 Service.svc

    <system.serviceModel>
    <services>
      <service name="WFService.Service1" behaviorConfiguration="WFService.Service1Behavior">
        <endpoint name="json" address="json" binding="webHttpBinding" bindingConfiguration="webHttpBindingConfig" contract="WFService.IService" behaviorConfiguration="WFServiceJsonEndpointBehavior"/>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:3003/WFServiceHost/"/>
          </baseAddresses>
        </host>
      </service>
    </services>
于 2012-04-09T18:09:47.533 回答