In my case, I use .Net 8 and deploy to IIS. I forget to copy runtimes folder to publish folder and i got same error after copy runtimes folder it fixed