【问题标题】:Nservicebus Multiple Endpoints ErrorNservicebus 多端点错误
【发布时间】:2014-10-13 04:02:21
【问题描述】:

我在本地运行 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 网站上的指南设置分销商/工人,但没有成功。

【问题讨论】:

    标签: c# asp.net msmq nservicebus


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      对我来说,该消息引用了两个不同的项目,问题是我引用了一个项目与另一个项目。我删除了引用并停止收到错误。

      【讨论】:

        【解决方案3】:

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

        【讨论】:

          【解决方案4】:

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

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

          【讨论】:

          • 感谢您为我们指明了正确的方向。部署中有嵌套文件夹,其中包含相同的部署文件,nservicebus 必须已经在上面运行程序集扫描并另外读取这些端点。
          • 伙计,我有一个意思:对 ReSharper 添加的项目的引用,它具有相同的 Config-Entry。
          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-04-13
          • 2013-12-27
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多