Q:

Trying to add AutoMapper to .NetCore1.1 - not recognising services. AddAutoMapper()

I've installed the following Nuget packages into my project:

Automapper
AutoMapper. 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. 

A:

I just ran into this problem and came to know that 
You need to include following Nuget package AutoMapper. Extensions. Microsoft. Dependencyinjection

A:

I'm running into the same issue, so checked the sourcecode and tests for guidance.  It seems you need to pass either an assembly or a "marker type" inside the assembly you want scanned.  I went for the following as my Profile classes are in the same assembly as the Startup class. 
services. AddAutoMapper(typeof(Startup));

A:

Not sure why this is happening, it could very well be something to do with .NET Core 1.1 but I have found a workaround. 
Instead of doing services. AddAutoMapper() in ConfigureServices, replace it with the below. 
var config = new AutoMapper. MapperConfiguration(cfg =>
            {
                cfg. AddProfile(new MappingProfile());
            });

            var mapper = config. CreateMapper();
            services. AddSingleton(mapper);

Where MappingProfile() is the class in which you have your CreateMap.