MVC newbie here... I just put together my first ever MVC web site, and it works in development. Now I publish it to my local IIS 7.5 using "Web deploy", to "localhost", "Default Web Site/MySite". The "Mark as IIS application on destination" and "Leave extra files..." checkboxes are unchecked.
Publish succeeds. So I open my browser and go to http://localhost/MySite, and get the error "HTTP Error 403.14 - Forbi开发者_JAVA技巧dden - The Web server is configured to not list the contents of this directory."
Huh? I thought the whole idea of the controller was that you don't have to specify a default page; it works out for you which page you want? Or have I misunderstood something?
How does your web.config look like? Depending on version of IIS you need to include runAllManagedModulesForAllRequests="true"
on your modules-section. You should add this hotfix http://support.microsoft.com/kb/980368 so you don't need this attribute.
This caught me once - I had forgotten to include the Global.asax file. Has that definitely been deployed?
In IIS i had to move the static file handler over the extensionless URL handler for automatic SSL renewal. This followed in getting this error. Fixed it by adding Global.asax to the default document list.
精彩评论