Methode nicht gefunden: „Boolean Microsoft.AspNetCore.Authorization.IAuthorizationPolicyProvider.get_AllowsCachingPolici
Posted: 21 Dec 2024, 18:02
Ich habe ein ASP.NET Core 8-Web-API-Projekt erstellt.
Aber wenn ich das Projekt ausführe, erhalte ich diese Fehlermeldung:
System.MissingMethodException : 'Methode nicht gefunden: 'Boolean Microsoft.AspNetCore.Authorization.IAuthorizationPolicyProvider.get_AllowsCachingPolicies()'.'
Der Fehler tritt bei app.Run();
aufvar builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();
Ich verstehe es nicht. Ich habe das Paket Microsoft.AspNetCore.Authorization installiert, aber ich habe immer noch das gleiche Problem.
Weiß jemand, was das Problem ist?
Aber wenn ich das Projekt ausführe, erhalte ich diese Fehlermeldung:
System.MissingMethodException : 'Methode nicht gefunden: 'Boolean Microsoft.AspNetCore.Authorization.IAuthorizationPolicyProvider.get_AllowsCachingPolicies()'.'
Der Fehler tritt bei app.Run();
aufvar builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();
Ich verstehe es nicht. Ich habe das Paket Microsoft.AspNetCore.Authorization installiert, aber ich habe immer noch das gleiche Problem.
Weiß jemand, was das Problem ist?