1

Migration from .Net 6.0 To .Net 7 Automapper having issues in Startup.cs

 Severity   Code    Description Project File    Line    Suppression State
 Error  CS1503  Argument 1: cannot convert from 'System.Reflection.Assembly' to 
 'System.Collections.Generic.IEnumerable<AutoMapper.Profile>'

enter image description here

User
  • 1,334
  • 5
  • 29
  • 61

1 Answers1

-1

You can use this lines of code to solve the problem:

services.AddAutoMapper(Assembly.GetAssembly(typeof(Program)));
Milad Ashrafi
  • 17
  • 1
  • 4
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 03 '23 at 03:34