NServiceBus 5.0对象引用未设置为NServiceBus.Unicast.Queuing.QueuesCreator.Install上的对象实例

NServiceBus 5.0对象引用未设置为NServiceBus.Unicast.Queuing.QueuesCreator.Install上的对象实例,nservicebus,Nservicebus,这可能与: ? 我正在使用nservicebus 5.0.3和azurestorage队列 我得到一个: Object reference not set to an instance of an object 当代码成功通过endpointconfig后启动时-下面是stacktrace at NServiceBus.Unicast.Queuing.QueuesCreator.Install(String identity, Configure config) at NSe

这可能与: ?

我正在使用nservicebus 5.0.3和azurestorage队列

我得到一个:

   Object reference not set to an instance of an object
当代码成功通过endpointconfig后启动时-下面是stacktrace

   at NServiceBus.Unicast.Queuing.QueuesCreator.Install(String identity, Configure config)
   at NServiceBus.Features.InstallationSupport.Starter.Run(Configure config)
   at NServiceBus.Configure.<Initialize>b__8(IWantToRunWhenConfigurationIsComplete o)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at NServiceBus.Configure.Initialize()
   at NServiceBus.Bus.Create(BusConfiguration configuration)
   at NServiceBus.GenericHost.PerformConfiguration(Action`1 moreConfiguration) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 121
   at NServiceBus.GenericHost.Start() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Hosting.Windows\GenericHost.cs:line 70
   at NServiceBus.Hosting.Windows.WindowsHost.Start() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Hosting.Windows\WindowsHost.cs:line 30
   at NServiceBus.Hosting.Windows.Program.<>c__DisplayClasse.<Main>b__6(WindowsHost service) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Hosting.Windows\Program.cs:line 80
   at Topshelf.Internal.ControllerDelegates`1.StartActionObject(Object obj) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ControllerDelegates.cs:line 18
   at Topshelf.Internal.IsolatedServiceControllerWrapper`1.<>c__DisplayClass2.<set_StartAction>b__1(TService service) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\IsolatedServiceControllerWrapper.cs:line 65
   at Topshelf.Internal.ServiceController`1.<.cctor>b__1(ServiceController`1 sc) in c:\Projects\TopShelfForNSB\src\Topshelf\Internal\ServiceController.cs:line 35
   at Magnum.StateMachine.LambdaAction`1.Execute(T instance, Event event, Object parameter) in :line 0
   at Magnum.StateMachine.EventActionList`1.Execute(T stateMachine, Event event, Object parameter) in :line 0
位于NServiceBus.Unicast.Queuing.QueuesCreator.Install(字符串标识,配置配置)
位于NServiceBus.Features.InstallationSupport.Starter.Run(配置配置)
在NServiceBus.Configure.b_u8(iwanttorunhen配置完成o)
at System.Collections.Generic.List`1.ForEach(操作`1操作)
在NServiceBus.Configure.Initialize()上
在NServiceBus.Bus.Create(总线配置)
在c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Hosting.Windows\GenericHost.cs:第121行中的NServiceBus.GenericHost.PerformConfiguration(操作'1 moreConfiguration)处
在c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Hosting.Windows\GenericHost.cs中的NServiceBus.GenericHost.Start()处:第70行
在c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Hosting.Windows\WindowsHost.cs中的NServiceBus.Hosting.Windows.WindowsHost.Start()处:第30行
在c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Hosting.Windows.Program.c_uu中显示classe.b_uu6(WindowsHost服务):第80行
在c:\Projects\topshelfornsb\src\Topshelf\Internal\ControllerDelegates`1.StartActionObject(Object obj)中的Topshelf.Internal.ControllerDelegates中:第18行
在c:\Projects\topshelfornsb\src\Topshelf\Internal\isolatedservicecontrollerrapper`1.c_u显示Class2.b_u1(服务服务)在c:\Projects\topshelfornsb\src\Topshelf\Internal\isolatedservicecontrollerrapper.cs:第65行
在c:\Projects\topshelfornsb\src\Topshelf\Internal\ServiceController`1.b_uuu1(ServiceController`1 sc)中的Topshelf.Internal.ServiceController`1(ServiceController`1 sc):第35行
在Magnum.StateMachine.LambdaAction`1.Execute(T实例、事件、对象参数)中:第0行
在Magnum.StateMachine.EventActionList`1.Execute(T StateMachine,事件,对象参数)中:第0行
以下是我的端点配置:

    void IConfigureThisEndpoint.Customize(BusConfiguration configuration)
    {
        var container = BuildContainer();
        configuration.EndpointName(ConfigurationManager.AppSettings["BusQueueName"]);
        configuration.UseTransport<AzureStorageQueueTransport>();
        configuration.UseContainer<AutofacBuilder>(c => c.ExistingLifetimeScope(container));
        configuration.UsePersistence<RavenDBPersistence>();
    }

    private IContainer BuildContainer()
    {
        var builder = new ContainerBuilder();
        var domainAssemblies = AppDomain.CurrentDomain.GetAssemblies();
        builder.RegisterAssemblyModules(domainAssemblies);
        return builder.Build();
    }
void IConfigureThisEndpoint.Customize(总线配置)
{
var container=BuildContainer();
configuration.EndpointName(ConfigurationManager.AppSettings[“BusQueueName”]);
configuration.UseTransport();
configuration.UseContainer(c=>c.ExistingLifetimeScope(容器));
configuration.UsePersistence();
}
专用IContainer BuildContainer()
{
var builder=new ContainerBuilder();
var domainAssemblies=AppDomain.CurrentDomain.GetAssemblies();
builder.RegisterAssemblyModule(域程序集);
返回builder.Build();
}

我最终从5.03降级到5.0,这解决了问题。

您的.config文件是否具有Azure存储帐户的正确凭据?很好的猜测-我尝试了,但它是正确的。还有一件事,您正在使用Azure transport和RavenDB。两者都需要指定NServiceBus/传输连接字符串。我尝试过不使用RavenDB,代码运行正常。如果你能分享你的复制,会更容易调查。谢谢肖恩的评论。我最终从5.0.3降到了5.0.0,这解决了问题issue@HugoForte这与我们如何复制这个问题无关?嗨,雨果,从技术上讲,你不应该降级。您是否介意在GitHub.com/special/nservicebus/issues上打开GitHub上的问题?谢谢,我想这可能和