Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

411
Vistas
AspNetCore.Authorization: System.ArgumentNullException: 'Value cannot be null. (Parameter 'configure')'

I'm getting an exception while trying to run the .net 3.1 application.

public class Program
{
    public static void Main(string[] args)
    {
        var host = CreateWebHostBuilder(args).Build(); --> Exception here!

Here is the exception:

System.ArgumentNullException: 'Value cannot be null. (Parameter 'configure')'

Not sure what is the problem?

using Microsoft.AspNetCore.Authorization; (Version=5.0.0.0)
using Microsoft.AspNetCore.Mvc.Authorization;

services.AddControllers(options =>
{
    var policy = new AuthorizationPolicyBuilder()
                        .RequireAuthenticatedUser()
                        .Build();
    options.Filters.Add(new AuthorizeFilter(policy));
});
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Solved by downgrading the nuget package of Microsoft.AspNetCore.Authorization from 5.0.0 into 3.1.0 (the project is .net-core 3.1).

over 4 years ago · Santiago Trujillo Denunciar

0

Another solution - update all Microsoft.AspNetCore.* packages in all projects to 5.* or 6.* versions. I did update up to 6.0.* and it is working now. I assume that 3* is not compatible with 5 and 6 versions of Microsoft.AspNetCore subpackages.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda