In my case even though I used all the solutions mentioned above but nothing worked for me. So I decided to uninstall docker and install it again.
Now in the process, I have noticed that I did not check Use Windows containers instead of Linux containers (this can be changed after installation)
in my previous installation, and that is why I got the problem above and the solutions still did not fix it. So ensure to check it before you run desktop docker or uninstall it and install it again by checking this option.