title: Automapper mapping validation during application startup in .net core?
body: <p>When I was using Automapper v6 (I'm using .net core), I had this command to validate configuration :</p>
  <pre><code>   configuration.AssertConfigurationIsValid();
  </code></pre>
  <p>But now, after moving to the latest version, I don't have this since my config is exactly (<a href="https://docs.automapper.org/en/latest/Dependency-injection.html#asp-net-core" rel="nofollow noreferrer">docs</a>):</p>
  <pre><code>   private void ConfigureServices(IServiceCollection services)
          {
              services.AddAutoMapper(typeof(AppSettingsMappingProfile));    //marker type    
          }
  </code></pre>
  <p>However, I still want to validate all mappings at startup .</p>
  <p>The docs says that I need to do this :</p>
  <pre><code>var configuration = new MapperConfiguration(cfg =&gt;
    cfg.CreateMap&lt;Source, Destination&gt;());
  
  configuration.AssertConfigurationIsValid();
  </code></pre>
  <p>But I don't have it since I'm using profiles with this command :</p>
  <pre><code> services.AddAutoMapper(typeof(AppSettingsMappingProfile)); 
  </code></pre>
  <p><strong>Question</strong>:</p>
  <p>How can I still make AutoMapper scan for validation at startup?</p>