None of the other solutions worked for me. I resolved this issue by using the commands below.
For 32 bit machine:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis –i
For 64 bit machine:
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis –i
The issue is because the web.config file is not installed correctly.