Search code examples
iisasp.net-coreasp.net-core-2.0iis-10

Error running ASP Core on IIS


okay, I created a ASP Core 2.0.5-Website and put it on my IIS-Server (Windows Server 2016), but every time I try to run it I get "HTTP Error 502.5 - Process Failure"

In the Windows-Events I get the following Error:

Application 'MACHINE/WEBROOT/APPHOST/KASSENUTZER' with physical root 'C:\KasseUser\' failed to start process with commandline 'dotnet .\Kasse_UserAPI.dll', ErrorCode = '0x80004005 : 80008081.

Web.Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\Kasse_UserAPI.dll" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout"/>
  </system.webServer>
</configuration>
<!--ProjectGuid: C25C6BB9-DA77-48E5-AF4E-1B6853F974F3-->

In the stdout-logfile I get the following

The application to execute does not exist: 'C:\KasseUser\Kasse_UserAPI.dll'

NOTE: To get this file I needed to change stdoutLogFile from ".\logs\stdout" to "..\logs\stdout". Otherwise I got the following Warning in the Windowsevents

 Warning: Could not create stdoutLogFile \\?\C:\KasseUser\logs\stdout_1888_20185394736.log, ErrorCode = -2147024891.

All directories exist and if I input "dotnet .\Kasse_UserAPI.dll" in cmd, it starts without Errors and can be accessed.

Here is the Content of my Directory

I uploaded it by publishing the Project locally in visual Studio. Then Uploading it to the Server via Remotedesktop and putting it into the Server-Directory.


Solution

  • Okay, I have no idea how, but I found a solution, I copied the c:\logs\ directory and deleted everything inside and named it KasseUser2, then put my project in it and changed the Directory in IIS to the new one, and now it works. No Idea why.