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”
任何想法,它的解决方案是什么?
答案 0 :(得分: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>