小编Adr*_*iel的帖子

如何解决“无法绑定到地址http://127.0.0.1:5000:地址已在使用中”。

我使用 Visual Studio 创建了一个 Asp.Net Core 应用程序,并使用 VS 的发布选项在我的 Azure 帐户上发布我的应用程序。

发布后,我使用该链接访问我的网站,但收到“HTTP 错误 500.30 - ASP.NET Core 应用程序无法启动”

我转到 Azure 中的控制台手动启动我的应用程序并了解有关该问题的更多详细信息,然后我得到了这个。控制台上出现错误

不太确定如何解决我的端口的这个问题

以下是program.cs中的代码

var connectionString = builder.Configuration.GetConnectionString("LocalConnection");
builder.Services.AddDbContext<LotharDataBaseContext>(options =>
    options.UseSqlServer(connectionString));

builder.Services.AddControllersWithViews();

builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
   .AddNegotiate();

builder.Services.AddAuthorization(options =>
{
    // By default, all incoming requests will be authorized according to the default policy.
    options.FallbackPolicy = options.DefaultPolicy;
});
builder.Services.AddRazorPages();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
    app.UseExceptionHandler("/Home/Error");
    // The default HSTS value is 30 days. You may want …
Run Code Online (Sandbox Code Playgroud)

c# asp.net azure asp.net-core

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

asp.net ×1

asp.net-core ×1

azure ×1

c# ×1