I was using VS2019 v16.1.3 and right clicked added an item and selected a Docker File. When clicking the run (Docker) button I encountered this issue. I upgraded to v16.1.5 which also restarted VS2019. Running the application using Docker then worked.