When we try to solve the issue HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents of this directory, I realised enabling directory listing will not help Website to work on IIS while I was having problem to run my ASP.NET Web application.
Problem
My ASP.Net Web application was not working as expected and it was just displaying my application files list when I navigate to my application.
First I received the issue HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents of this directory. I enabled Direcory Browsing to solve the issue, then I realised this issue where I could see list of files instead my ASP.NET application working.
Solution
To solve this problem we do not required to enable the Directory Browsing feature in IIS Manager.
In my case problem was different, in my windows some of the features related to Application Developement in IIS was not enabled.
To verify that Search Windows Features On or Off in your windows or it will be present under control panel. If the features under Application Developement Features not enabled, then enable all features except CGI as shown in below image.
After enabled above features my ASP.Net Web application started working.
Summary
Its not required to Enable Directory Browsing in IIS manager and its not recommanded due to security concerns. In my case some of the IIS Features were not enabled, I could enable them and application started working.