Базово работает
gRPC на отдельном порту
This commit is contained in:
@@ -1,2 +1,21 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
Console.WriteLine("Hello, World!");
|
||||
using ConsoleApp;
|
||||
using ConsoleApp.Logging;
|
||||
using ConsoleApp.Services;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
var configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(AppContext.BaseDirectory)
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: false)
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
|
||||
using var _ = ConsoleLog.Configure();
|
||||
|
||||
var services = new ServiceCollection();
|
||||
services.AddSingleton<IConfiguration>(configuration);
|
||||
services.AddConsoleApp(configuration);
|
||||
|
||||
await using var provider = services.BuildServiceProvider();
|
||||
await using var scope = provider.CreateAsyncScope();
|
||||
await scope.ServiceProvider.GetRequiredService<ConsoleAppRunner>().RunAsync(CancellationToken.None);
|
||||
|
||||
Reference in New Issue
Block a user