Вот что у меня сейчас есть в файле Program.cs:
Код: Выделить всё
var builder = WebApplication.CreateBuilder(args);
var services = builder.Services;
services.AddControllersWithViews();
services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
.AddNegotiate();
services.AddAuthorization(options =>
{
options.FallbackPolicy = options.DefaultPolicy;
});
var app = builder.Build();
if (!app.Environment.IsDevelopment())
app.UseExceptionHandler("/Home/Error");
app.UseStatusCodePagesWithReExecute("/Home/Error", "?statusCode={0}");
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.AddGenericBookingSystemEndpoints();
});
app.Run();
Код: Выделить всё
InvalidOperationException: Attempting to use an incomplete authentication context.
Microsoft.AspNetCore.Authentication.Negotiate.NegotiateHandler.HandleAuthenticateAsync()
Сейчас я использую последнюю версию Visual Studio. 2022 и .NET.
Подробнее здесь: https://stackoverflow.com/questions/723 ... on-context
Мобильная версия