I don't know if your case is the same as mine but I accidentally tried to inject Mapper instead of IMapper when using Automapper. That seemed seemed to be the one causing the issue, now it works.
Mapper
IMapper