c# - Nservicebus 多端点错误

标签 c# asp.net msmq nservicebus

我已经在本地运行 NSB 一段时间了,一切正常!当需要将其移动到服务器时,我似乎已经准备好一个分发器/工作人员架构来实现可扩展性。但是,当在服务器分配器或工作人员上运行 NSB 时,它给了我一个我似乎无法理解或解决的错误:

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 网站上的指南设置分发者/工作人员,但没有成功。

最佳答案

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

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

关于c# - Nservicebus 多端点错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25393830/

相关文章:

c# - stackoverflow 中的标签列表

msmq - NServiceBus:如何从错误队列中移动消息

sql - MSMQ v 数据库表

c# - 如何以编程方式检查 NServiceBus 是否已完成所有消息的处理

c# - 可从检查器编辑的变换列表

c# - 属性参数中的正则表达式约束抛出错误

c# - 使用数据属性使 web api 以键值作为键序列化字典

c# - 在 ASP.NET MVC 中对 Post 请求执行代码

C# 使用 Interop 写入打开的 Excel 文件

C# 构造函数有 2 个参数,但声称它没有带两个参数的构造函数