Несмотря на удаление ссылки на класс Startup и создание файла класса программы для Host Builder и зависимостей. инъекции, консоль вывода по-прежнему ссылается на класс Startup.

Код файла программы:
Код: Выделить всё
net8.0
v4
Exe
enable
enable
PreserveNewest
PreserveNewest
Never
Код: Выделить всё
var host = new HostBuilder()
.ConfigureFunctionsWebApplication()
.ConfigureAppConfiguration(builder =>
{
string AppConfigurationConnection = Environment.GetEnvironmentVariable("AppConfig");
builder.AddAzureAppConfiguration(options =>
{
options.Connect(new Uri(AppConfigurationConnection), new DefaultAzureCredential())
.ConfigureKeyVault(kv =>
{
kv.SetCredential(new DefaultAzureCredential());
})
.Select("*")
.ConfigureRefresh(refresh =>
{
refresh.Register("Control", refreshAll: true)
.SetCacheExpiration(new TimeSpan(0, 0, 30));
});
});
})
.ConfigureServices(services =>
{
// If using Kestrel:
services.Configure(options =>
{
options.AllowSynchronousIO = true;
});
// If using IIS:
services.Configure(options =>
{
options.AllowSynchronousIO = true;
});
services.AddAzureAppConfiguration();
services.AddOptions()
.Configure((settings, configuration) =>
{
configuration.GetSection("value").Bind(settings);
});
services.AddHttpClient();
services.AddSingleton();
})
.Build();
await host.RunAsync();
Код: Выделить всё
Error: read ECONNRESET
Request Headers
Content-Type: application/json
User-Agent: PostmanRuntime/7.37.0
Accept: */*
Postman-Token: 80bafe6e-83f3-4d92-9013-ece684c7c610
Host: localhost:7071
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

Подробнее здесь: https://stackoverflow.com/questions/781 ... igrating-f