I've installed the following Nuget packages into my project:
AutomapperAutoMapper.Extensions.Microsoft.DependencyInjection
I have added the line to ConfigureServices in Startup.cs.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
// . . .
services.AddAutoMapper();
}
I'm still getting a red line under services.AddAutoMapper(). It says:
The Call is ambiguous between the following methods or properties: ServiceCollectionExtensions.AddAutoMapper(IServiceCollection, params Assembly[]) and ServiceCollectionExtensions.AddAutoMapper(IServiceCollection, params Type[])
Why is this happening? All the .NET Core add automapper guides I've read show to do it this way.