I'm working with an interface generated by from a wsdl, and I'm running into an issue when trying to host my service as a Windows Service.
The following line appears above the interface. Unless I change it from
[System.ServiceModel.ServiceContractAttribute(Namespace="http://xxxxxx.com/", ConfigurationName="IService")]
to
[System.ServiceModel.ServiceContract]
I can't start the Windows service that hosts my program (the error log in the event viewer says the contract IService could not be found in the list of contracts implemented by Service.) I'm listing the endpoint my app.config file as follows:
endpoint address=""
binding="basicHttpBinding"
contract="Service.IService"
This also happens when I change the contract to "http://xxxxxxx.com/IService" as it appears in the ServiceContractAttribute. Any ideas about how I can fix this?
The service portion of the config file:
<service name="Service.Service"
behaviorConfiguration="myServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/Service"/>
</baseAddresses>
</host>
<endpoint address=""
binding="basicHttpBinding"
contract="Service.IService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="Service.IService" />
</service>
<behaviors>
<serviceBehaviors>
<behavior name="myServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>