This error usually occurs because Network Service account doesn’t have permission on the virtual directory. There might be other reasons as well, however; the reason because of which I was getting this error is Network Service account.
1. Right click virtual directory folder and select Properties --> Security.
2. Click Add… button.
3. Type in Network Service and click Check Names button.
4. Give it Full control.
5. Click Apply then OK.
6. Reset IIS.
This solution worked for me, I hope it’ll work for you guys as well.