我正在使用从wsdl生成的接口,并且在尝试将我的服务作为Windows服务托管时遇到了问题。App.config命名空间问题
接口上方出现以下行。除非我从
[System.ServiceModel.ServiceContractAttribute(Namespace="http://xxxxxx.com/", ConfigurationName="IService")]
将其更改为
[System.ServiceModel.ServiceContract]
我无法启动Windows服务承载我的程序(错误日志在事件查看器中的合同IService无法在找到说通过服务实现的合同清单)我列出端点我app.config文件如下:
endpoint address=""
binding="basicHttpBinding"
contract="Service.IService"
当我改变合同“http://xxxxxxx.com/IService”,因为它也会发生这种情况出现在ServiceContractAttribute中。有关我如何解决这个问题的任何想法?
配置文件的服务部分:
<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>
这听起来不像端点配置问题,而是服务配置问题。你的属性提到ConfigurationName =“IService”:你可以发布名称=“IService”的app.config元素? –
itowlson
2009-10-16 19:35:43