I created a sample Blazor web assembly application in .net 6 and then upgraded it to .net 8 got the similar errors while deploying it to Azure App Service.
Mostly, the error you've encountered occurs because of the NuGet packages, that are different in both the versions.
Thank you, @Akif T, for the clear explanation. I referred to this doc to know how to migrate from .NET 6 to .NET 8.
To resolve the issue I've deleted the bin and obj folder from my application.
And also cleared the Nuget packages as shown below
Go to Nuget package manager -> general -> hit clear All NuGet Storage.

Then again reinstall your packages and redeploy to Azure Web App.
After doing the above changes I was able deploy the application to Azure Web App without any issues.
