我使用 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)