Hello, This is a Russian speaking Q&A. Would you like to continue working on your issue in Russian? In case you wish to continue in English, you may ask your question on the English Q&A: https://learn.microsoft.com/en-us/answers/
How to run multiple IHostService implementation in IHost?
Hi everybody. Did somebody add two or more IHostServices to HostApplicationBuilder and it works?
This is my code:
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.Services.AddSingleton<IMetadataService, MetadataService>();
builder.Services.AddTransient<ConversionWorker>();
builder.Services.AddTransient<ESignWorker>();
builder.Services.AddHostedService<ConversionService>();
builder.Services.AddHostedService<ESignService>();
IHost host = builder.Build();
host.Run();
But works just first added service ConversionService