title: ASP.NET Core 1.1 fails to run when published
body: <p>I had an ASP.NET Core application that I just went in an upgraded to 1.1.  This application worked fine previously and I could publish it (through Publish Command in Visual Studio) and it worked fine under IIS.  I recent changed this be 1.1 and got the application to run in debug mode fine.  Now when I publish it I get </p>
  
  <pre><code>502 - Web server received an invalid response while acting as a gateway or proxy server.
  </code></pre>
  
  <p>I turned on Failed Request Tracing Rules and in there I see the following</p>
  
  <pre><code>MODULE_SET_RESPONSE_ERROR_STATUS 
  
  ModuleName httpPlatformHandler 
  Notification EXECUTE_REQUEST_HANDLER 
  HttpStatus 502 
  HttpReason Bad Gateway 
  HttpSubStatus 3 
  ErrorCode The server is currently disabled. (0x8007053d) 
  </code></pre>
  
  <p>My published web.config file looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;handlers&gt;
        &lt;remove name="httpPlatform" /&gt;
        &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /&gt;
      &lt;/handlers&gt;
      &lt;aspNetCore processPath="dotnet" arguments=".\Cranalytics.dll" forwardWindowsAuthToken="true" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>My project.json file looks like this</p>
  
  <pre><code>{
    "dependencies": {
      "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
      "Microsoft.EntityFrameworkCore": "1.1.0",
      "Microsoft.EntityFrameworkCore.InMemory": "1.1.0",
      "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
  
      "Microsoft.AspNetCore.Diagnostics": "1.1.0",
      "Microsoft.AspNetCore.Mvc": "1.1.0",
      "Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.0",
      "Microsoft.AspNetCore.StaticFiles": "1.1.0",
      "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
      "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
  
      "Microsoft.Extensions.Caching.Memory": "1.1.0",
      "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
  
      "Syncfusion.Compression.MVC": "14.2600.0.32-preview2-final",
      "Syncfusion.XlsIO.MVC": "14.2600.0.32-preview2-final",
  
      "Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
  
      "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
      "Microsoft.Extensions.Configuration.Json": "1.1.0",
      "Microsoft.Extensions.Logging.Console": "1.1.0",
      "Microsoft.Extensions.Logging.Debug": "1.1.0",
  
      "Microsoft.NETCore.App": {
        "version": "1.1.0",
        "type": "platform"
      },
  
      "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
    },
  
    "tools": {
      "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
    },
  
    "frameworks": {
      "netcoreapp1.1": {
        "imports": [
          "dotnet5.6",
          "portable-net45+win8"
        ]
      }
      //"net461": {
      //  "dependencies": {
      //  },
      //  "imports": "dnxcore50"
      //}
    },
  
    "buildOptions": {
      "emitEntryPoint": true,
      "preserveCompilationContext": true
    },
  
    "runtimeOptions": {
      "configProperties": {
        "System.GC.Server": true
      }
    },
  
    "publishOptions": {
      "include": [
        "wwwroot",
        "web.config",
        "appsettings.Production.json",
        "appsettings.Staging.json",
        "appsettings.json"
      ]
    },
  
    "scripts": {
      "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
    }
  }
  </code></pre>
  
  <p>I can't find out what the problem is with the configuration or IIS.</p>
  
  <p>Edit:
  I made some changes to configuration and am now past the module loading section (at least according to the Trace Log).  Now I'm just getting 404 whenever I visit the website.  I can view static images without a problem, but when I view the home page to the site I get a 404 error</p>
  
  <pre><code>ModuleName AspNetCoreModule 
  Notification EXECUTE_REQUEST_HANDLER 
  HttpStatus 404 
  HttpReason Not Found 
  HttpSubStatus 0 
  ErrorCode The operation completed successfully. (0x0) 
  </code></pre>
  
  <p>My published directory structure is a sub site underneath the root site in IIS (/Cranalytics).  Then in that folder is all of the various DLL, along with the web.config.  Under this directory is the wwwroot directory from the project.  The IIS subsite is set pointing to the root site (/Cranalytics).</p>