I have the following code that add automapper to my app.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddHttpClient();
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
}
The AppDomain.CurrentDomain.GetAssemblies() returns only assemblies that were loaded at the time it is called.
I can see that some of my assemblies which contain my mappings have not been yet loaded and as a result mappings are not loaded which returns me errors about missing map types.
How do I get all assemblies referenced by my project?