This is an issue when your application doesn’t have permission to access the directory. So to run your application successfully you need to give some permissions to it. Also in this case asp.net will not appear in IIS manager because it was not applied in IIS. I am using windows 7 so the solution may work in windows 10 or upper versions.
Follow the below instructions to remove this error :-
- First Open your “control panel”
- Then click on “Programs”
3. Now click on “Turn Windows features on or off”
4. Now to go “Internet Information Services” tab and expand it.
5. Now expand “Application Development Features”
6. Now select ASP.Net and Click on OK.
7. Now it will ask your permission to download and apply the necessary files in your machine.
8. Once this process gets done then restart your visual studio and try to run your application. It will work as you expect.