我正在使用 ServiceModelEx 的服务总线部分。(并使用 AppFabric 自动启动 WCF 服务)。我有一些奇怪的行为......
基本上,当我第一次调用服务总线时,所有正确的事件都会沿着链触发(通过查看数据库并查看记录的值来验证)。
但是在随后的调用中,没有任何反应。就好像事件永远不会发生......
.svclogs 没有显示任何有用的信息,事实上,它们甚至没有注册后续事件。
但是,对于订阅到总线的每个服务,Windows 事件日志确实显示以下错误:
WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/777031
Exception: System.ServiceModel.ServiceActivationException: The service '/AcmeWidgets.WidgetFactory.Subscribers.WidgetBuilder/BuildService.svc' cannot be activated due to an exception during compilation. The exception message is: The type 'AcmeWidgets.WidgetFactory.Subscribers.WidgetBuilder.BuildService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.. ---> System.InvalidOperationException: The type 'AcmeWidgets.WidgetFactory.Subscribers.WidgetBuilder.BuildService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
--- End of inner exception stack trace ---
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
Process Name: w3wp
Process ID: 3052
我知道服务属性值是正确的,显然是因为它第一次运行正确。
有任何想法吗???
编辑 1:要添加到这种奇怪的行为,如果我在 Visual Studio 中“重建”解决方案,第一次调用总线工作,所有事件链下触发,然后所有后续调用再次失败