title: AspNetCore Could not load type 'Swashbuckle.AspNetCore.SwaggerGen.SwaggerResponseAttribute'
body: <p>I have ASP.NET Core Web application where I am using swagger using the following:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddMvc();
      services.AddSwaggerGen(c =&gt;
      {
          c.OperationFilter&lt;ExamplesOperationFilter&gt;();
          c.OperationFilter&lt;DescriptionOperationFilter&gt;();
          c.SwaggerDoc("v1", new Info
          {
              Version = "v1",
              Title = "API",
              Description = "",
          });
          // Set the comments path for the Swagger JSON and UI.
          var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
          var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
          c.IncludeXmlComments(xmlPath);
      });
  }
  
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
      app.UseSwagger();
      app.UseSwaggerUI(c =&gt; { c.SwaggerEndpoint("/swagger/v1/swagger.json", "API"); });
      if (env.IsDevelopment())
      {
          app.UseDeveloperExceptionPage();
      }
  
      app.UseMvc();
  }
  </code></pre>
  
  <p>When I navigate to url/swagger I am getting the following error:</p>
  
  <blockquote>
    <p>fail: Microsoft.AspNetCore.Server.Kestrel[13]
          Connection id "0HLG1T7PRT05H", Request id: An unhandled exception was thrown by the
    application. System.TypeLoadException: Could not load type
    'Swashbuckle.AspNetCore.SwaggerGen.SwaggerResponseAttribute' from
    assembly 'Swashbuckle.AspNetCore.SwaggerGen, Version=3.0.0.0,
    Culture=neutral'.at
    Swashbuckle.AspNetCore.Examples.DescriptionOperationFilter.SetResponseModelDescriptions(Operation
    operation, ISchemaRegistry schemaRegistry, ApiDescription
    apiDescription)    at
    Swashbuckle.AspNetCore.Examples.DescriptionOperationFilter.Apply(Operation
    operation, OperationFilterContext context)    at
    Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateOperation(ApiDescription
    apiDescription, ISchemaRegistry schemaRegistry)    at
    Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItem(IEnumerable<code>1
    apiDescriptions, ISchemaRegistry schemaRegistry)    at
    System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable</code>1
    source, Func<code>2 keySelector, Func</code>2 elementSelector,
    IEqualityComparer<code>1 comparer)    at
    Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItems(IEnumerable</code>1
    apiDescriptions, ISchemaRegistry schemaRegistry)    at
    Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String
    documentName, String host, String basePath, String[] schemes)    at
    Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext
    httpContext)    at
    Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1
    application)</p>
  </blockquote>
  
  <p>The nuget packages I installed are:</p>
  
  <p>Swashbuckle.AspNetCore v3.0.0</p>
  
  <p>Swashbuckle.AspNetCore.Examples v2.9.0</p>