【问题标题】:NServiceBus - Exception when starting endpoint. Value cannot be null. Parameter name: endpointNServiceBus - 启动端点时出现异常。值不能为空。参数名称:端点
【发布时间】:2020-09-05 02:04:47
【问题描述】:

我正在使用 NServiceBus 6.4.3 和 RabbitMQ 传输 4.4.5

我在尝试运行我的项目时遇到了这个异常:

FATAL: NServiceBus.Logging.NLog.Logger.Fatal - Exception when starting endpoint. System.ArgumentNullException: Value cannot be null.
    Parameter name: endpoint
       at NServiceBus.Receiving.<>c.<.ctor>b__0_1(SettingsHolder s) in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Transports\Receiving.cs:line 17
       at NServiceBus.Features.Feature.ConfigureDefaults(SettingsHolder settings) in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Features\Feature.cs:line 213
       at NServiceBus.Features.FeatureActivator.SetupFeatures(IConfigureComponents container, PipelineSettings pipelineSettings, RoutingComponent routing) in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Features\FeatureActivator.cs:line 53
       at NServiceBus.InitializableEndpoint.<Initialize>d__1.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\InitializableEndpoint.cs:line 60
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at NServiceBus.GenericHost.<Start>d__1.MoveNext() in C:\Build\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 48

我不知道从哪里开始调查这个错误。

【问题讨论】:

    标签: nservicebus


    【解决方案1】:

    您使用的是旧版本的 NServiceBus.Host。 NullReferenceException 已在最新版本中修复,如果您升级到 NServiceBus 7,那么您也将升级 NServiceBus.Host。

    【讨论】:

      【解决方案2】:

      我只是回答这个问题,以便如果其他人碰巧偶然发现这个错误,这样你就不会浪费时间弄清楚这意味着什么。

      我错误地在我的EndpointConfig.cs 中打了这个电话:

      endpointConfiguration.DefineEndpointName(ConfigurationManager.AppSettings["EndpointName"]);
      

      我的app.config 中没有那个EndpointName 的密钥。 在我的例子中,我刚刚删除了对 DefineEndpointName 的调用,因为它被错误地添加了,但是如果您确实需要为端点定义一个名称,请确保您拥有正确的名称。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-12-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多