I have just upgraded our ASP.NET Core 2.0 application to 2.1. It builds and deploys fine, but I get the above error when attempting to launch it from our local web server (IIS). I get the same error when launching it from Azure too.
The error logs give me the following error.
Application 'MACHINE/WEBROOT/APPHOST/OSCAR_INTERNAL_HTTPS' with physical root 'C:\OscarWeb_Test\' failed to start process with commandline 'dotnet .\OscarWeb.dll', ErrorCode = '0x80004005 : 80008083.
When I launch the application from the commandline I get the following error.
It says there is a missing assembly, but it is there in the project, and was there before I upgraded. For some reason it cannot find the assembly since upgrading to ASP.NET Core 2.1
There are multiple reasons as to why this error may arise. I'll try highlighting two reasons causing this issue for me:
The first answer to the question posted on the link below really helped me. ASP.NET Core 1.0 on IIS error 502.5
Calling your .dll file of your project in the cmd using the dotnet command will help you understand exactly what the issue is. In my case there was a version error for ASP.NET core. Make sure all your project dependencies in the .csproj file of your project use the same version of ASP.NET core SDK and runtime bundle. You can check the versions present on your system through the dotnet command on cmd:
I also kept getting the HTTP 502.5 error because of an incorrect configuration in my hosts file at C:\Windows\System32\drivers\etc. Make sure the IP and port that your application is listening on is correctly configured in the hosts file.
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> <ItemGroup>
It works for both on-premise (IIS) and Azure deployments.
A fuller explanation of the property is given in this article
I was having the same issue in 2.1 make sure you have same version of .net core run time(x86/x64) and window server hosting of .net core in the environment you are setting the application. Below are the settings required mine is now 2.2 but it will work for 2.1 as well and it has worked for me also.
User contributions licensed under CC BY-SA 3.0