502 bad gateway nginx | .NET location: /usr/share/dotnet No frameworks were found

You must install or update .NET to run this application.
Architecture: x64
Framework: ‘Microsoft.AspNetCore.App’, version ‘8.0.0’ (x64)
.NET location: /usr/share/dotnet No frameworks were found.
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
Solution:
Build Error-Free, Production-Ready .NET Applications
Steps1:
sudo apt remove dotnet*
sudo apt remove aspnetcore*
sudo apt remove netstandard*
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install dotnet-sdk-8.0
Step2:
1.First, add Microsoft’s package signing key to your list of trusted keys and add the package repository:
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb


