Прикрутил правильно bll
This commit is contained in:
@@ -3,32 +3,60 @@ using PARR.GeneratorTemplatesWorker;
|
||||
using Serilog;
|
||||
|
||||
|
||||
IHost host = Host.CreateDefaultBuilder(args)
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.InstallGeneratorTemplateServices(hostContext.Configuration);
|
||||
//hostContext.Configuration.AddGeneratorTemplateConfigurations(services);
|
||||
//services.AddGeneratorTemplateSettings(hostContext.Configuration);
|
||||
var builder = Host.CreateApplicationBuilder();
|
||||
|
||||
//services.AddHostedService<Worker>();
|
||||
})
|
||||
//.ConfigureAppConfiguration((hostContext, configBuilder) =>
|
||||
//{
|
||||
//TODO: !!! !!! !!! не смог прикрутить AddGeneratorTemplateConfigurations, не могу прокинуть туда сервисы
|
||||
// configBuilder.AddGeneratorTemplateConfigurations(hostContext.Services);
|
||||
//})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.AddGeneratorTemplateSettings(hostContext.Configuration);
|
||||
builder.Services.AddLogging(config =>
|
||||
{
|
||||
config.ClearProviders();
|
||||
var logger = new LoggerConfiguration()
|
||||
.WriteTo.Console()
|
||||
.ReadFrom.Configuration(builder.Configuration)
|
||||
.CreateLogger();
|
||||
config.AddSerilog(logger);
|
||||
});
|
||||
|
||||
services.AddHostedService<Worker>();
|
||||
})
|
||||
.UseSerilog((hostContext, services, config) =>
|
||||
{
|
||||
config
|
||||
.WriteTo.Console()
|
||||
.ReadFrom.Configuration(hostContext.Configuration);
|
||||
})
|
||||
.Build();
|
||||
builder.Services.InstallGeneratorTemplateServices(builder.Configuration);
|
||||
builder.Configuration.AddGeneratorTemplateConfigurations(builder.Services);
|
||||
builder.Services.AddGeneratorTemplateSettings(builder.Configuration);
|
||||
|
||||
builder.Services.AddHostedService<Worker>();
|
||||
|
||||
var host = builder.Build();
|
||||
host.Run();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//IHost host = Host.CreateDefaultBuilder(args)
|
||||
// .ConfigureServices((hostContext, services) =>
|
||||
// {
|
||||
// services.InstallGeneratorTemplateServices(hostContext.Configuration);
|
||||
// //hostContext.Configuration.AddGeneratorTemplateConfigurations(services);
|
||||
// //services.AddGeneratorTemplateSettings(hostContext.Configuration);
|
||||
|
||||
// //services.AddHostedService<Worker>();
|
||||
// })
|
||||
// .ConfigureAppConfiguration((hostContext, configBuilder) =>
|
||||
// {
|
||||
// //TODO: !!!!!!!!!не смог прикрутить AddGeneratorTemplateConfigurations, не могу прокинуть туда сервисы
|
||||
// configBuilder.AddGeneratorTemplateConfigurations(hostContext.Services);
|
||||
// })
|
||||
// .ConfigureServices((hostContext, services) =>
|
||||
// {
|
||||
// services.AddGeneratorTemplateSettings(hostContext.Configuration);
|
||||
|
||||
// services.AddHostedService<Worker>();
|
||||
// })
|
||||
// .UseSerilog((hostContext, services, config) =>
|
||||
// {
|
||||
// config
|
||||
// .WriteTo.Console()
|
||||
// .ReadFrom.Configuration(hostContext.Configuration);
|
||||
// })
|
||||
// .Build();
|
||||
|
||||
//host.Run();
|
||||
|
||||
Reference in New Issue
Block a user