VSG24 VSG24 - 1 year ago 464
C# Question

ASP.NET Core 1.0 on IIS error 502.5

I just updated my server (Windows 2012R2) to

.Net Core 1.0 RTM
Windows Hosting pack from the previous
.Net Core 1.0 RC2
. My app works on my PC without any issues but the server keeps showing:

HTTP Error 502.5 - Process Failure

Common causes of this issue:

The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port

It previously worked with the RC2 version. Don't know what could go wrong.

This is all event viewer says:

Failed to start process with the commandline 'dotnet .\MyWebApp.dll'. Error code = '0x80004005'.

the worst part is that app logs are empty! I mean those stdout_xxxxxxxxx.log files are completely empty and all have 0 byte size.

What should I do?? How can I know the cause of error when there is not log??

Answer Source

So I got a new server, this time it's Windows 2008R2 and my app works fine.

I can't say for sure what the problem was with the old server but I have one idea.

So because I previously compiled the app without any platform in mind it gave me the dll version which only works if the target host has .Net Core Windows Hosting package installed. In my case it was installed and that was fine.

After the app didn't work I decieded to compile it as a console app with win7-x64 as runtime. This time the moment I ran the exe of my app on the server, it crashed with an error about a missing dll:

The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing

That dll is from Universal C Runtime that's included in the Visual C++ Redistributable for Visual Studio 2015.

I tried to install that package (both x64 & x86) but it failed each time (don't know why) on Windows Server 2012 R2.

But when I tried to install them in the new server, Windows Server 2008 R2, they successfully installed. That might have been the reason behind it, but still can't say for sure.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download