Well, I faced the same problem when I tried to migrate an MS SQL DB based project to Postgres running in a Docker Container. Whatever I tried, nothing seemed to work until finally I removed all projects from the solution except the StartUp Application (the main project). Even if this could not compile, now adding Docker via Docker compose worked right out of the hat. And then re-adding the formerly removed projects/modules worked like a charm. This is definitely worth a try.