Migration from .Net 6.0 To .Net 7 Automapper issues

1.5k views Asked by At

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

1

There are 1 answers

1
Milad Ashrafi On

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

services.AddAutoMapper(Assembly.GetAssembly(typeof(Program)));