ASP.NET MVC on IIS 7.5

2018-12-31 14:38发布

I'm running Windows 7 Ultimate (64 bit) using Visual Studio 2010 RC. I recently decided to have VS run/debug my apps on IIS rather than the dev server that comes with it.

However, every time I try to run an MVC app, I get the following error:

HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. Detailed

Error Information

Module DirectoryListingModule

Notification ExecuteRequestHandler

Handler StaticFile Error

Code 0x00000000 Requested

URL http://localhost:80/mySite/

Physical Path C:\myProject\mySite\

Logon Method Anonymous Logon

User Anonymous

I placed a default.aspx file in the directory and I received the following error:

HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Are there any other steps I forgot to take to get this working?

Notes: I installed IIS 7.5 after installing VS 2010 RC. I used the built-in "Create Virtual Directory" button under the "Web" tab in the MVC project's "Properties" in Visual Studio 2010. I made sure that the application is using the ASP.NET 4 App Pool.

Below are the installed features of IIS I have.

alt text

28条回答
何处买醉
2楼-- · 2018-12-31 15:28

I have met the same 404.14 problem suddenly. Finally the problem had been fixed by unchecking "precompile while publishing" in the publish profile settings.

查看更多
何处买醉
3楼-- · 2018-12-31 15:28

I altered my default route at one point from:

routes.MapRoute(
"Default",
    "{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = UrlParameter.Optional }

To:

routes.MapRoute(
"Default",
    "{controller}/{action}/{id}",
    new { controller = "Home", action = "Index" }

Which gave me your error. Glad someone mentioned routing because I probably would've been on this forever.

查看更多
高级女魔头
4楼-- · 2018-12-31 15:28

In my case .NET CRL Version in Application pool prppertires was set to No managed code (do not know why). Setting it to .NET CRL Version v4.0.30319 solved the problem.

查看更多
步步皆殇っ
5楼-- · 2018-12-31 15:29

Sweet Jesus. I tried all of the above things (but found my settings identical). YET ANOTHER SOLUTION if you are having issues:

http://support.microsoft.com/kb/980368

Try installing this KB for your system. If you are seeing 404s it might be because you don't have this update -- and the isapi module just isn't getting found and there's not a lot you can do about that without this!

查看更多
登录 后发表回答