Код: Выделить всё
warn: Microsoft.AspNetCore.Server.Kestrel[0]
Overriding address(es) 'http://*.11111'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
Hosting failed to start
System.IO.IOException: Failed to bind to address http://[::]:80: address already in use.
appsettings.json:
р>
Код: Выделить всё
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"urls": "http://*.11111;http://192.168.1.169:11111;http://localhost:11111;http://:11111;http://*:11111"
}
Код: Выделить всё
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
Constants.LoadConstants();
builder.WebHost.UseUrls(new string[]
{
"http://*.11111",
"http://192.168.1.169:11111",
"http://:11111",
"http://0.0.0.0:11111",
"http://*:11111"
});
builder.Services.AddControllers().AddJsonOptions(options =>
{
options.JsonSerializerOptions.PropertyNamingPolicy = null;
});
var app = builder.Build();
// Configure the HTTP request pipeline.
app.Urls.Add("http://*.11111");
app.MapControllers();
app.Run();
Подробнее здесь: https://stackoverflow.com/questions/787 ... other-port