Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC4 web api not finding default document once deployed to webserver

It works on localhost, but finds no default document on the webserver and complains about directory browsing being disabled. IIS7 on both, and both websites/app pools seem to be configured identically.

I've used the web api template in VS2012, which doesn't actually have any views. It only has an Index controller action in the HomeController.

Any ideas on why this could produce different behavior in the two environments?

like image 705
natpen Avatar asked Jan 14 '13 18:01

natpen


1 Answers

So this addition to my web.config:

<system.webServer>
  <modules runAllManagedModulesForAllRequests="true" />
<system.webServer>

fixed the problem. It seems to be required in the web.config for IIS7 on Windows 2008 Server, but not for IIS7 on Windows 7.

like image 183
natpen Avatar answered Oct 05 '22 13:10

natpen