Over night an (internal, luckily) MVC web application has stopped working for me, without anything being changed as far as I know. The application itself absolutely hasn't been tinkered with in the last two days and the same goes for IIS.
The problem is that I get a directory listing of my www-folder instead of the applications default action (/Home/Index
).
My www-folder contains the standard stuff:
bin
Content
Scripts
Views
Global.asax
Web.config
I have tried:
Now, this has happened once before. At the time I was on vacation and it was solved by restarting the entire World Wide Web Publishing Service. While it might work this time as well, I'd rather figure out the root of the problem before temporarily fixing it just to have it happen again further down the road. So while a WWW Publishing Service restart might get the site running again I'd rather understand why it happened in the first place before fixing it this way.
Finally, note that I'm running other MVC apps on the same IIS server and have never gotten this problem with them.
If you are expecting to see an existing site however, and instead you see the directory listing something has gone wrong somewhere. The file may have been infected via a php injection attack and removed by a malware scanner. The site may have been attacked. Your account password may not be very secure.
Description. Directory browsing allows the contents of a directory to be displayed upon request from a web client. If directory browsing is enabled for a directory in IIS, users could receive a web page listing the contents of the directory.
C:\Windows\Microsoft.NET\Framework\<version>
folder.aspnet_regiis -i
That's all!
A little late.... But as I was receiving the same result.
My Application Pool was targeting the wrong .Net version (should be same as web app Target Framework). Simply adjusted within the "Set Application Pool Defaults" option, restarted and it was solved.
Hope it helps someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With