How to Fix HTTP Error 502.3 – Bad Gateway in ASP.NET Core

Hello again, we will continue about other error that you can find when you published your Core. You can read our past article about error messages in core. Here we go!

Error Message

Sometimes when you upgraded your core, you can get error HTTP Error 502.3 – Bad Gateway The specified CGI application encountered an error and the server terminated the process. Below is the error message that you see:


<?xml version="1.0" encoding="utf-8"?>

      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    <aspNetCore processPath=".\MyApp.exe" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />


  "buildOptions": {
  "emitEntryPoint": true,
  "preserveCompilationContext": true,
  "warningsAsErrors": true
"dependencies": {
  "Microsoft.AspNetCore.Diagnostics.Elm": "0.1.0",
  "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
  "Microsoft.AspNetCore.Authorization": "1.0.0",
  "Microsoft.AspNetCore.Diagnostics": "1.0.0",
  "Microsoft.AspNetCore.Hosting": "1.0.0",
  "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0",
  "Microsoft.AspNetCore.Http.Extensions": "1.0.0",
  "Microsoft.AspNetCore.Localization": "1.0.0",
  "Microsoft.AspNetCore.Mvc": "1.0.0",
  "Microsoft.AspNetCore.Routing": "1.0.0",
  "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
  "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
  "Microsoft.AspNetCore.Session": "1.0.0",
  "Microsoft.AspNetCore.StaticFiles": "1.0.0",
  "Microsoft.Extensions.Caching.SqlServer": "1.0.0",
  "Microsoft.Extensions.Logging.Console": "1.0.0",
  "Microsoft.Extensions.Logging.Debug": "1.0.0",
  "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",

  "Microsoft.AspNetCore.Razor.Tools": {
    "version": "1.0.0-preview2-final",
    "type": "build"

  "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
  "Microsoft.Extensions.Configuration.Json": "1.0.0",
  "Microsoft.Extensions.Logging": "1.0.0",
  "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0"

"frameworks": {
   "net461": {}

"tools": {
  "BundlerMinifier.Core": "2.0.238",
  "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
  "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"

"scripts": {
  "prepublish": [ "bower install", "dotnet bundle" ],
  "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"

"publishOptions": {
  "include": [


There are 4 steps to fix the issue:

– You can read documentation about how to migrate your to core on Microsoft. We have also written article about how to migrate your core to 5 on our previous post.

– Run the published .\MyApp.exe from the command line.

  • If it does, you know you have an IIS integration problem.
  • If it does not, you know you have an application problem.

– Change stdoutLogEnabled="false" to true and then check the logs at stdoutLogFile=".\logs\stdout". The error(s) there might tell you something.

– Check your IIS Application logs in the Event Viewer. The error(s) there might tell you something.

Event Viewer Application Logs


Hope above post help you to fix your issue! In case you’re looking for core web hosting, please kindly visit our site at

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *