Home > Enterprise >  System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested typ
System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested typ

Time:04-22

I am building an API on Visual Studio 2019 net5.0 and I was just adding the lasts controllers and validators when my program suddenly stopped working.

The error that I'm getting:

System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.
Could not load file or assembly 'Crijoya.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se ha intentado cargar un programa con un formato incorrecto.'

I get this error on my Statup ConfigureServices method when loading the assemblies. Here's the code:

//use and register all the mappings
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());

I have tried following these solutions but I can't get to the problem: enter image description here

I made sure that in the properties of each of them the platform was Any CPU

enter image description here

And finally that on Tools I was using the 64 bit version for IIS Express for web projects

enter image description here

  • Related