11

I have upgraded an ASP.net Core 1.1 app to ASP.net Core 2.0 with the following steps:

  • Changed the Target Framework to 2.0
  • Upgraded all Nugget Packages

Now my auto deployment from git runs and says it is successful but the app does not run. I get the following error:

HTTP Error 502.5 - Process Failure

I also added a separate web app deployment slot and tried deploying it there and still get the same result. I have also tried deploying it manually to the slow and no change.

Jonathan
  • 1,725
  • 3
  • 19
  • 45
  • 3
    Possible duplicate of [.net-core-2.0 azure app service 502.5 error](https://stackoverflow.com/questions/45694286/net-core-2-0-azure-app-service-502-5-error) – mason Aug 15 '17 at 17:13
  • 1
    Yes, it does sound like it could be. @Jonathan, can you try change mentioned there? – David Ebbo Aug 15 '17 at 18:52

4 Answers4

5

The accepted answer did not fix the problem for me.

Steps Required:

Launch Azure Console within the app and delete the contents of the wwwroot folder then redeploy.

RMDIR wwwroot /S /Q

Also, if you have installed the Application Insights Extension within your app. When the app starts you will receive an exception stating that it can't be found.

To fix this error reinstall the Application Insights Extension from the Extensions blade and restart the app.

The problem with the wwwroot folder is that the old Core 1.1 files are not overwritten. Removing the contents of the directory resolves the problem.

code
  • 4,073
  • 3
  • 27
  • 47
  • The is the real work solution. the previous one is mentioned in the migration guide from 1.1 to 2.0 on Microsoft docs site, so that should not be the failed reason. – frank Sep 25 '17 at 16:49
  • works. just when you in the command line inside the wwwroot, you should move up to remve the folder `cd ..` – serge Sep 26 '17 at 16:49
  • I removed wwwroot as suggested but when redeploy got this error: An error occurred when the request was processed on the remote computer. Could not find a part of the path 'D:\home\site\wwwroot\App_Offline.htm'. – dragonfly02 Oct 09 '17 at 20:27
  • Not sure about that file, this question might help: https://stackoverflow.com/questions/6254516/how-to-use-iis-app-offline-htm-file-with-azure – code Oct 10 '17 at 00:46
  • Resolved by deleting the directory and re-publishing from VS17: Logs showed **"Application 'MACHINE/WEBROOT/APPHOST/xyz' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline 'dotnet .\WebApp.dll', ErrorCode = '0x80004005 : 8000808c."** – lko Nov 19 '17 at 12:40
1

I had the same problem, which was caused by files leftover from a previous .NET Core 1.1 deployment. The easiest way to fix this is to check the "Remove additional files at destination" under the File Publish Options in your Publish Settings when publishing to Azure from VS.

File Publish Options

Stefan
  • 41
  • 1
  • 4
0

I had to add the following to all the .csproj files in the solution

<ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
  </ItemGroup>
Jonathan
  • 1,725
  • 3
  • 19
  • 45
0

This problem also happens when using DevOps Pipeline for the code targeted to dotnet core 2.1. This is because as of today 10/2, Azure is using DotNetCore 3.0 as default runtime (at least that's what it looks to be). To resolve this problem in devops pipeline, you must install the SDK

Yaml Code:

 steps:
 - task: UseDotNet@2
  displayName: 'Install Core 2.1'
inputs:
  version: 2.2.104

PS: This tells me that you've to install SDK on destination machine too, for dotnet to compile in correct version. (Azure or Windows Server whichever is your destination)