ASP.NET Core 1.0 on Iis Error 502.5

ASP.NET Core 1.0 on IIS error 502.5

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.

Error 502.5 - Process Failure ASP.NET Core 1.1

Most likely, you're missing the Visual C++ 2015 Runtime (available here). The hosting package attempts to download and install this during installation, but if there's a network issue or the server isn't able to connect outside (common in Enterprise environments), then it fails, and you'll need to install it manually with the redistributable.

I can't recall whether it was required or not the last time I hit this issue, but you may want to restart your server again, afterwards, just in case.

EDIT

If you're still having issues, try running your app from the command line via:

dotnet MyApp.dll

This will let you see any exceptions being raised at startup.

If you get an error like:

It was not possible to find any compatible framework version ...

Make sure you have the specific runtime for the version of ASP.NET Core your application is targeting. At the moment, that's either 2.0.3 (for all 2.X apps) or LTS 1.1.5 (for all 1.X apps). You can find the latest runtimes here.

ASP.NET Core 2.1 IIS hosting error 502.5 - Unable to execute dotnet command to determine cause

You've likely got this issue: https://github.com/aspnet/Home/issues/1931. The ASP.NET Core IIS Module reads the Web.config to determine what to execute to run the app.

You said running dotnet ".\My_Project Integration.dll" worked successfully and enabling stdout showed the same issue of the path being truncated after the space.

Two options:

  1. Remove the space from your project (this would be the easiest option)
  2. Update your Web.config

If you do #2, your Web.config needs to have something like this for the arguments attribute:

arguments='".\My_Project Integration.dll"'

HTTP Error 502.5 - Process Failure in ASP.NET Core 2.1 application

The solution is to set the property PublishWithAspNetCoreTargetManifest to false. I have set this in the .csproj as follows.

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

It works for both on-premise (IIS) and Azure deployments.

A fuller explanation of the property is given in this article

IIS fails to run ASP.NET Core site - HTTP Error 502.5

Your problem is a bad web.config file:

<aspNetCore requestTimeout="02:00:00" 
processPath="%LAUNCHER_PATH%"
arguments="%LAUNCHER_ARGS%"
stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout"
forwardWindowsAuthToken="false" />

The path %LAUNCHER_PATH% does not exist on your system, it is not even valid. It should be something like:

<aspNetCore requestTimeout="02:00:00" 
processPath=".\yourAppName.exe"
arguments="somePossibleArgument"
stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout"
forwardWindowsAuthToken="false" />

Notice that the web.config file is completely ignored if the app is launched from the command line, that's why you do not receive the error.

ASP.NET Core 2.0 on IIS error 502.5

You may have the same problem as described here in aspnet/IISIntegration repo. The solution is to add the following into .csproj file:

<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

And in general, the source of this problem is that the dotnet version on your local computer and the dotnet version on the server are different.

ASP.NET Core 2.0 - HTTP Error 502.5 Process Failure with IIS

I found a solution for my problem.

It was the NLOG dll which causes this problem. I checked what changed between the new version and the other and one of te modifications was the NLOG implementation. I removed it, publish a new version and put it on my server. It worked without errors !
I don't know if the dll is not compatible with my setup or if I used it badly in my program.cs. I will need to do some tests to try to implement this dll again... or just find an other logging dll :)

When running Asp.NET Core App the app fails to launch with a 502.5 Process error on local IIS

After spending sometime on this, none of the fixes suggested worked. After spending a lot of time looking up what the potential issue is, I decided to check for any available visual studio updates.

After I updated Visual Studio 2017 everything worked.

I hope this helps someone.



Related Topics



Leave a reply



Submit