title: IIS fails to run ASP.NET Core site - HTTP Error 502.5
body: <p>We have a Windows 2012 R2 machine.
  I had an existing ASP.NET Core site on it that had a working published ASP.NET Core site running.</p>
  
  <p>However when I published to the site again today a month later after I made changes, I can't access the site anymore and get the following error in my browser</p>
  
  <blockquote>
    <p>HTTP Error 502.5 - Process Failure</p>
    
    <p>For more information visit: <a href="http://go.microsoft.com/fwlink/?LinkID=808681" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkID=808681</a></p>
  </blockquote>
  
  <p>If I log onto the server and click on the exe in my deployed directory it opens a command prompt and shows my site on port 5000. If I access the site on <a href="http://localhost:5000" rel="noreferrer">http://localhost:5000</a> it works perfectly so the problem is to do with IIS and not the site itself.</p>
  
  <p>If I log onto the server I can see the following in Windows EventViewer </p>
  
  <p><a href="https://i.stack.imgur.com/sT39K.png" rel="noreferrer"><img src="https://i.stack.imgur.com/sT39K.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE/MySite' with physical root 'D:\Sites\MySite\' failed to start process with commandline '"%LAUNCHER_PATH%" %LAUNCHER_ARGS%', ErrorCode = '0x80070002 : 0.</p>
  </blockquote>
  
  <p>When I visit the link in the browser error message it mentioned reinstalling the .net Core Hosting bundle which I did. However the error message in the browser is the same.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;handlers&gt;
        &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /&gt;
      &lt;/handlers&gt;
      &lt;aspNetCore requestTimeout="02:00:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" /&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>When I look at my app log folder a stdout file does get created for every time it tries to access this site but each time it is of size 0KB and empty contents.</p>
  
  <p>Why does IIS refuse to work suddenly where it worked previous but the app works if I access the compiled exe directly?</p>