我有一个非常简单的服务,在不使用Castle的情况下工作正常(显示其他代码是正确的)。 我改变了我的SVC文件到以下几点:与Castle Windsor注册wcf服务
<%@ ServiceHost Service="Reporting.WebService.ReportingWebService" Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory, Castle.Facilities.WcfIntegration" %>
,并使用XML作为后续注册服务:
<component id="Reporting.WebService.ReportingWebService"
service="Reporting.WebService.IReportingWebService, Reporting.WebService"
type="Reporting.WebService.ReportingWebService, Reporting.WebService">
</component>
但我收到以下错误:
[InvalidOperationException: Could not find a component with name Reporting.WebService.ReportingWebService, did you forget to register it?] Castle.Facilities.WcfIntegration.WindsorServiceHostFactory`1.CreateServiceHost(String constructorString, Uri[] baseAddresses)
....
任何想法为什么它没有注册? ?
---- ----更新
我这个在Windsor配置:
<facilities>
<facility id='wcf'
type='Castle.Facilities.WcfIntegration.WcfFacility,
Castle.Facilities.WcfIntegration' />
</facilities>
和ReportingWebService在另一个组件implimented。
ReportingWebService与网站或在单独的程序集相同的程序集?你有没有注册WcfFacility? – Bronumski
请参阅问题更新。 – mans
认为你错过了更新的东西:)。没关系,我认为这给了我一个想法。 – Bronumski