I had this same error after updating a project to .net8 to .net9 that had docker support. I had forgotten to update my Dockerfile to point to the newer images, after fixing (regenerating) the docker files the error message went away for me.
Dockerfile