版本5.0.0 NServiceBus无法启动

时间:2014-08-07 14:32:16

标签: nservicebus

我的NServiceBus.Host.exe.config配置如下: 我收到这个错误:

2014-08-07 16:30:33.842 ERROR NServiceBus.GenericHost Exception when starting endpoint.
System.Configuration.ConfigurationErrorsException: Faults forwarding requires an error queue to be specified. Please add a 'MessageForwardingInCaseOfFaultConfig' section to your app.config
 or configure a global one using the powershell command: Set-NServiceBusLocalMachineSettings -ErrorQueue {address of error queue}
   at NServiceBus.Faults.Forwarder.ForwarderFaultManager.Setup(FeatureConfigurationContext context) in d:\Development\Github\NServiceBus\src\NServiceBus.Core\Faults\Forwarder\ForwarderFaultManager.cs:line 54
   at NServiceBus.Features.FeatureActivator.ActivateFeature(FeatureState feature, List`1 featuresToActivate, FeatureConfigurationContext context) in d:\Development\Github\NServiceBus\src\NServiceBus.Core\Features\FeatureActivator.cs:line 186
   at NServiceBus.Features.FeatureActivator.SetupFeatures(FeatureConfigurationContext context) in d:\Development\Github\NServiceBus\src\NServiceBus.Core\Features\FeatureActivator.cs:line 115
   at NServiceBus.Configure.Initialize() in d:\Development\Github\NServiceBus\src\NServiceBus.Core\Configure.cs:line 197
   at NServiceBus.GenericHost.Start() in d:\Development\Github\NServiceBus\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 58

配置文件如下。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig,
NServiceBus.Core" />
    <section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core"/>
  </configSections>

  <MessageForwardingInCaseOfFaultConfig ErrorQueue="error"/>
  <MsmqTransportConfig NumberOfWorkerThreads="1" MaxRetries="5"/>
</configuration>

端点配置如下所示:

  class EndpointConfig : IConfigureThisEndpoint, INeedInitialization
  {
    public void Customize(ConfigurationBuilder builder)
    {
      builder.Conventions(c => c
          .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.EndsWith("RequestResponse")));
    }

    public void Init(Configure config)
    {
    }
  }

1 个答案:

答案 0 :(得分:0)

未创建error队列。 尝试手动创建队列并再次运行。