Nservicebus多端点错误

时间:2014-08-19 22:12:00

标签: c# asp.net msmq nservicebus

我已在本地运行NSB一段时间了,一切正常!当把它移到服务器上时,我似乎有一个分销商/工人架构来实现可扩展性。但是,当在服务器分发服务器上运行NSB时,OR工作者会给我一个我似乎无法理解或错过的错误:

Unhandled Exception: System.InvalidOperationException: Host doesn't support host
ing of multiple endpoints. Endpoint classes found: Namespace.EndpointCo
nfig, Namespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null,
Namespace.EndpointConfig, Namespace, Version=1.0.0.0, Culture
=neutral, PublicKeyToken=null You may have some old assemblies in your runtime d
irectory. Try right-clicking your VS project, and selecting 'Clean'.
   at NServiceBus.Hosting.Windows.EndpointTypeDeterminer.AssertThatNotMoreThanOn
eEndpointIsDefined(List`1 endpointConfigurationTypes) in y:\BuildAgent\work\31f8
c64a6e8a2d7c\src\NServiceBus.Hosting.Windows\EndpointTypeDeterminer.cs:line 150
   at NServiceBus.Hosting.Windows.EndpointTypeDeterminer.GetEndpointConfiguratio
nType(HostArguments arguments) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServi
ceBus.Hosting.Windows\EndpointTypeDeterminer.cs:line 81
   at NServiceBus.Hosting.Windows.Program.Main(String[] args) in y:\BuildAgent\w
ork\31f8c64a6e8a2d7c\src\NServiceBus.Hosting.Windows\Program.cs:line 41

我正在配置我的端点:

     public class EndpointConfig : IConfigureThisEndpoint, AsA_Server,
     IWantCustomInitialization
        {

我的端点如下所示:

 <add Assembly="HEC.Messages" Endpoint="hec.messageservice@servername" />

我正在运行以生成此错误的命令是......

    E:\Services\NServiceBus.Host.exe /install ABC.messageservice 
/username:domain\ouruser /password:value NServiceBus.Distributor 
NServiceBus.Production NServiceBus.PerformanceCounters

我不知道我在这里做错了什么,或者导致错误的是什么。我怀疑我的端点配置不正确,但我不确定要改变什么,我尝试按照NSB网站上的指南设置经销商/工作人员没有运气。

4 个答案:

答案 0 :(得分:2)

看起来主机正在寻找EndPointConfig的两个实现。从错误消息中,它们似乎都被命名为相同,并且在同一名称空间中。

验证代码中只有一个IConfigureThisEndpoint实现。此外,请确保清除bin / runtime目录以确保主机找不到多个目录。根据您的错误消息,后者似乎更可能出现问题。

答案 1 :(得分:1)

对我来说,问题是我重命名/移动了名称空间,即使在clean之后,旧构建文件仍然存在。必须进入/bin/obj文件夹才能手动删除它们。

答案 2 :(得分:0)

对我来说,该消息引用了两个不同的项目,而问题是我已经将一个项目与另一个项目进行了引用。我删除了参考并停止获取错误。

答案 3 :(得分:0)

在端点配置中检查您的名称空间。

我在一个共享项目中评论了端点配置,它对我有用。