title: Exception when adding swagger with .NET Core 3.0
body: <p>I am trying to integrate swagger into a <code>ASP NET Core 3.0</code> project and it throws exception right in the <code>ConfigureServices</code> method:</p>
  
  <p>I am using <code>Swashbuckle.AspNetCore</code> 4.0.1.</p>
  
  <p>I have also checked this <a href="https://stackoverflow.com/questions/51842808/aspnetcore-could-not-load-type-swashbuckle-aspnetcore-swaggergen-swaggerrespons/51843217">issue</a> and also <a href="https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1259" rel="noreferrer">this</a></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
          {
  
  
              services.AddSwaggerGen(c =&gt;
              {
                  c.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
                  {
                      Version = "v1",
                      Title = " API",
                      Description="API for the  Server",
                  });
  
              });
          }
  </code></pre>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>System.AggregateException
    HResult=0x80131500
    Message=Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Swashbuckle.AspNetCore.Swagger.ISwaggerProvider Lifetime: Transient ImplementationType: Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator': Failed to compare two elements in the array.) (Error while validating the service descriptor 'ServiceType: Swashbuckle.AspNetCore.SwaggerGen.ISchemaRegistryFactory Lifetime: Transient ImplementationType: Swashbuckle.AspNetCore.SwaggerGen.SchemaRegistryFactory': Failed to compare two elements in the array.)
    Source=Microsoft.Extensions.DependencyInjection
    StackTrace:
     at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable`1 serviceDescriptors, ServiceProviderOptions options)
     at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options)
     at Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory.CreateServiceProvider(IServiceCollection containerBuilder)
     at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder)
     at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
     at Microsoft.Extensions.Hosting.HostBuilder.Build()
     at SXS.Server.Program.Main(String[] args) in C:\Work\SXS\SXS\Core\Server\SXS.Server\Program.cs:line 32
  
  Inner Exception 1:
  InvalidOperationException: Error while validating the service descriptor 'ServiceType: Swashbuckle.AspNetCore.Swagger.ISwaggerProvider Lifetime: Transient ImplementationType: Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator': Failed to compare two elements in the array.
  
  Inner Exception 2:
  InvalidOperationException: Failed to compare two elements in the array.
  
  Inner Exception 3:
  TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.MvcJsonOptions' from assembly 'Microsoft.AspNetCore.Mvc.Formatters.Json, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
  </code></pre>
  
  <p><strong>P.S</strong>  I have followed this <a href="https://www.talkingdotnet.com/clean-way-to-add-swagger-asp-net-core-application/" rel="noreferrer">guide</a> and the only difference is that while he uses a <code>OpenApiInfo</code> object i do not have that overload available and thus am using a <code>Info</code>.</p>