I was able to fix this error myself, and thought of sharing it here, so that it can be useful to someone else.
The problem was because, one of my colleague deleted the docker-compose file and docker file from my solution to re-enable the Docker support for some reason, and when we were trying to add the Docker support, we got this error.
Even though we deleted the Docker support file from Visual Studio solution, the files were not being deleted from the solution directory. As a fix, you must delete those files manually by going to that directory, after that you will be able to add the Docker support again to your project.