0
votes

I recently migrated from .NET Core 3.1 to .NET 5. I also switched my app services settings and made them use .NET 5 runtime.

Then I navigated to app url, but got a 500.30 error. To diagnose, I did the following as recommended by the docs

  • open Kudu,
  • open a powershell window,
  • navigate to the wwwroot folder
  • Run dotnet Myapp.dll

But my app runs well in kudu. In the application event logs, I get this error:

Application '/LM/W3SVC/1776254318/ROOT' with physical root 'D:\home\site\wwwroot' failed to load coreclr.
Exception message: CLR worker thread exited prematurely
Process Id: 11956.
File Version: 15.0.20349.2. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: 2670c...

According to the docs, this might be because I run a 32bit app on 64 bit OS. But after checking my OS which was win-64, I added the RID for win 64 and compiled my app. This still didn't work. Can someone help please ?

1

1 Answers

0
votes

I found out that my build pipeline yml wasn't written in the most efficient way. After building and testing my project via the pipeline, I didn't publish it correctly. I published the solution:

- task: DotNetCoreCLI@2
  displayName: 'preparing artifact .zip to publish'
  inputs:
    command: publish
    publishWebProjects: False
    arguments: 'MyApp.sln --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True

instead of publishing the project, which caused issues in deployment.

- task: DotNetCoreCLI@2
  displayName: 'preparing artifact .zip to publish'
  inputs:
    command: publish
    publishWebProjects: False
    arguments: 'MyApp/MyApp.csproj --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True