The error indicates a build error, not a deployment one. Can you confirm that the build is failing and not the deployment?
The error looks like to me a mismatch of frameworks. Did you happen to upgrade this project from NET Framework 4.x to NET 8? There is no NET Framework 8 which is what the error seems to be indicating to me. Migrating from NF 4.x to NET 8 is not a simple change in the target version. For example the project property identifying the framework changes from TargetFrameworkVersion
to TargetFramework
. Of course all this should be caught during the build.