我在所有环境中运行 Windows 7 64 位。通过包含我的两个程序集来隐式注册所有消息在开发中工作,但是 QA 和 Prod 需要显式注册,否则 NService 在启动时会引发异常。有没有人遇到过类似的情况,有解决办法吗?
例外
Source:NServiceBus.Core System.InvalidOperationException - No destination could be found for message type
xyz.Application.Claims.Messaging.IGlassWorkflowEventMessage. Check the <MessageEndpointMapping> section of the configuration
of this endpoint for an entry either for this specific message type or for its assembly.
Stack: at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType, Predicate`1 condition)
at CEI.Application.Claims.GlassSubscriber.SubscriberEndpointStartup.Run() in c:\xyz\tfs\Claimslink\DEV\Bus\GlassSubscriber\Config\SubscriberEndpointStartup.cs:line 36
at NServiceBus.Host.Internal.ConfigManager.<>c__DisplayClass1.<Startup>b__0()
我的配置条目
<!--This works in my development environment-->
<MsmqTransportConfig InputQueue="GlassSubscriber" ErrorQueue="GlassSubscriberError" NumberOfWorkerThreads="1" MaxRetries="2"/>
<UnicastBusConfig>
<MessageEndpointMappings>
<!--Just add assemblies, all messages recognized -->
<add Messages="xyz.shared.impl" Endpoint="msgsvcpubinputqueue"/>
<add Messages="xyz.Claims.impl" Endpoint="msgsvcpubinputqueue"/>
</MessageEndpointMappings>
</UnicastBusConfig>
<!--QA and Production always require explicit message registrations??-->
<MsmqTransportConfig InputQueue="GlassSubscriber" ErrorQueue="GlassSubscriberError" NumberOfWorkerThreads="1" MaxRetries="2"/>
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="xyz.shared.impl" Endpoint="msgsvcpubinputqueue"/>
<add Messages="xyz.Claims.impl" Endpoint="msgsvcpubinputqueue"/>
<!--We have dozens of messages, explicitly registering for each subscriber is a pain-->
<add Messages="xyz.Application.Claims.Messaging.IGlassWorkflowEventMessage, xyz.Claims.impl" Endpoint="msgsvcpubinputqueue"/>
<add Messages="xyz.Application.Claims.Messaging.GlassWorkflowEventMessage, xyz.Claims.impl" Endpoint="msgsvcpubinputqueue"/>
</MessageEndpointMappings>
</UnicastBusConfig>