title: Solve 404 error when hosting netcore 2.1 web api in IIS
body: <p>I'm publishing .netcore 2.1 web api project in IIS but i'm getting 404 error. I can run application from Visual studio and its working with swagger.</p>
  
  <p>already installed netcore 2.1 runtime, restarted environments, selected "No Managed Code" in my application pool but still getting 404 error.</p>
  
  <p>my launchSettings.json looks likde this:</p>
  
  <pre><code>{
    "$schema": "http://json.schemastore.org/launchsettings.json",
    "iisSettings": {
      "windowsAuthentication": false, 
      "anonymousAuthentication": true, 
      "iisExpress": {
        "applicationUrl": "http://localhost:65391",
        "sslPort": 44318
      }
    },
    "profiles": {
      "IIS Express": {
        "commandName": "IISExpress",
        "launchBrowser": true,
        "launchUrl": "swagger",
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Development"
        }
      },
      "QAAPI": {
        "commandName": "Project",
        "launchBrowser": true,
        "launchUrl": "swagger",
        "applicationUrl": "https://localhost:5001",
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Development"
        }
      }
    }
  }
  </code></pre>
  
  <p>my Startup.cs:</p>
  
  <pre><code>public Startup(IConfiguration configuration)
          {
              Configuration = configuration;
          }
  
          public IConfiguration Configuration { get; }
  
          // This method gets called by the runtime. Use this method to add services to the container.
          public void ConfigureServices(IServiceCollection services)
          {
  
              services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
              services.AddSwaggerGen(c =&gt;
                 {
                     c.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info { Title = "QA API", Description = ""});
  
                 }
              );
  
          }
  
  
          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
              else
              {
                  app.UseHsts();
              }
  
              app.UseHttpsRedirection();
              app.UseMvc();
  
              app.UseSwagger();
              app.UseSwaggerUI( c =&gt;
                  {
                      c.SwaggerEndpoint("/swagger/v1/swagger.json", "QA API");
                  }
              );
          }
  </code></pre>