Reputation: 136
NET MVC web app with WEBAPI and .NET 4.5 I host it on local IIS Server and it work properly in my matchain.
I host it on other 3 machine all have same configuration as WINDOWS-7 it work only on one machine and the others give error like bellow:
"the web server is configured to not list the contents of this directory."
I followed the steps below:
Control panel -> Program and Features -> Turn Windows Features on or of -> check all boxes of IIS and IIS Hostable Web Core
Install -> .NetFramework V4.5.1
Restart
in CMD as Admisistrator -> for 32bit & 64bit OS
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
Open IIS -> ISAPI and CGI Restrictions -> ASP.NET v4.0.30319 -> Allow
Sites -> Add Web Site
a. Site Name :- API b. application pool :- ASP.NET v4.0 Classic c. Path :- D:\API d. Port :- 8081 -> OK
Upvotes: 2
Views: 1808
Reputation: 908
I would try to run a hello world asp.net mvc application on the 3 machines to make sure mvc is working first. I also like to set my app pools to integrated mode and not classic. There must be configuration difference between the machine where it worked and the other 2 machines. Look into app pool settings values and into the machine web.config and do diff merge and you should notice the issue.
Upvotes: 1
Reputation: 73
You can enable directory browser in IIS solve my problem. Please see this screen shot
Upvotes: -1