我为我的NServiceBus提供了以下配置:
builder.Host.UseNServiceBus(ctx =>
{
var endpointConfiguration = new EndpointConfiguration("my.orders");
var transport = endpointConfiguration.UseTransport(new LearningTransport());
transport.RouteToEndpoint(
assembly: typeof(CreateOrderMessage).Assembly,
destination: "my.orders");
endpointConfiguration.UseSerialization<SystemJsonSerializer>();
var conventions = endpointConfiguration.Conventions();
conventions.DefiningMessagesAs(type =>
typeof(IDTestMessage).IsAssignableFrom(type)
);
return endpointConfiguration;
});
这将学习传输文件置于解决方案的根目录中.当我的docker内部运行时,会导致一个严重的崩溃(在本地运行良好).因此,我想指定用于学习传输文件的文件夹.
根据这里的文档https://docs.particular.net/transports/learning/,我试着像这样更新我的代码:
var endpointConfiguration = new EndpointConfiguration("my.orders");
var transport = endpointConfiguration.UseTransport(new LearningTransport());
transport.StorageDirectory("PathToStoreTransportFiles");
transport.RouteToEndpoint(
assembly: typeof(CreateOrderMessage).Assembly,
destination: "my.orders");
我得到了这个错误:
"设置"不包含 '登录目录'
也许在8版本的NServicebus库中,配置是不同的?或者我需要安装一个额外的nugget?我该怎么解决这个问题?