runtime: Application Build with sdk .NET9 were not working in Azure app service(Linux)

Description

I have a simple Blazor Server app that I upgraded from .NET8 to .NET9. No problem (Debug/Release). When deploying to Azure App Service, I get the error page : 😦 Application Error If you are the application administrator, you can access the [diagnostic resources].

I have no errror during my deployment. All lights are green

Reproduction Steps

Here’s my pipeline where I simply changed the SDK version from 8.0 to 9.0.100

trigger:
- master

pool:
  vmImage: ubuntu-latest

variables:
  buildConfiguration: 'Release'

steps:
- task: UseDotNet@2
  displayName: 'Installing .NET Core SDK...'
  inputs:
    packageType: 'sdk'
    version: '9.0.100'

- script: dotnet build --configuration $(buildConfiguration) myproj/myproj.csproj
  displayName: 'dotnet build $(buildConfiguration)...'
- task: DotNetCoreCLI@2
  displayName: 'Publishing App...'
  inputs:
    command: publish
    publishWebProjects: false
    projects: 'myproj/myproj.csproj'
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: true

- task: PublishBuildArtifacts@1
  displayName: 'Publishing Build Artifacts...'

My agent job :

steps:
- task: AzureRmWebAppDeployment@4
  displayName: 'Azure App Service Deploy: MyProj'
  inputs:
    azureSubscription: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    appType: webAppLinux
    WebAppName: SodeaSoftStore
    packageForLinux: '$(System.DefaultWorkingDirectory)/_Website /drop/MyProj.zip'
    RuntimeStack: 'DOTNETCORE|9.0'
    StartupCommand: 'dotnet MyProj.dll'

Expected behavior

The application should work properly without any errors as it runs properly in Local and works perfectly with .NET 8 ( local and deployed)

Actual behavior

only this error page : 😦 Application Error If you are the application administrator, you can access the [diagnostic resources].

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (12 by maintainers)

Most upvoted comments

it’s incomprehensible!! I spent hours… without ever trying to stop the web app and restart it! @bradygaster : plays lotto within the hour

Well, this is the first time I’ve had this problem since the .NET6>7 7>8 and 8>9 updates… mystery

@tossnet can you email me offline – want to get some more info to find root cause (timheuer [at] microsoft)

Thanks @tossnet glad you are resolved. Will talk with the team why maybe the redeploy or change in that setting didn’t trigger a restart.

Has the site been stoppped/restarted since the .NET 9 roll-out? Just curious.

No worries, like I said, I am trying to find the right folks offline. Sorry if my response sounded off-putting. Please stay tuned.

The target machine doesn’t have 9.0.0 installed. Here’s the relevant portion from that log:

2024-11-17T17:39:10.837608718Z Running user provided startup command... 
2024-11-17T17:39:10.966668299Z It was not possible to find any compatible framework version 
2024-11-17T17:39:10.966687500Z The framework 'Microsoft.NETCore.App', version '9.0.0' was not found. 
2024-11-17T17:39:10.966691600Z   - The following frameworks were found: 
2024-11-17T17:39:10.966694500Z       3.1.26 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 
2024-11-17T17:39:10.966697700Z 
2024-11-17T17:39:10.966700300Z You can resolve the problem by installing the specified framework and/or SDK. 
2024-11-17T17:39:10.966703600Z 
2024-11-17T17:39:10.966706300Z The specified framework can be found at: 
2024-11-17T17:39:10.966712500Z   - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=9.0.0&arch=x64&rid=debian.11-x64