我正在使用 Visual Studio 2010 RC 运行 Windows 7 Ultimate(64 位).我最近决定让 VS 在 IIS 上运行/调试我的应用程序,而不是在它附带的开发服务器上.
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.
但是,每次我尝试运行 MVC 应用程序时,都会收到以下错误:
However, every time I try to run an MVC app, I get the following error:
HTTP 错误 403.14 - 禁止 Web 服务器配置为不列出此目录的内容.详细
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. Detailed
错误信息
模块目录ListingModule
Module DirectoryListingModule
通知执行请求处理程序
处理程序静态文件错误
请求代码 0x00000000
Code 0x00000000 Requested
URL localhost:80/mySite/
物理路径 C:myProjectmySite
Physical Path C:myProjectmySite
登录方法匿名登录
匿名用户
我在目录中放置了一个 default.aspx 文件,但收到以下错误:
I placed a default.aspx file in the directory and I received the following error:
HTTP 错误 500.21 - 内部服务器错误处理程序PageHandlerFactory-Integrated"有一个坏模块ManagedPipelineHandler"它的模块列表
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?
注意:我在安装 VS 2010 RC 后安装了 IIS 7.5.我使用了 Visual Studio 2010 中 MVC 项目属性"中Web"选项卡下的内置创建虚拟目录"按钮.我确保该应用程序使用的是 ASP.NET 4 应用程序池.
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.
以下是我已安装的 IIS 功能.
Below are the installed features of IIS I have.
推荐答案ASP.NET 4 未在 IIS 中注册.不得不在命令行中运行以下命令/run
ASP.NET 4 was not registered in IIS. Had to run the following command in the command line/run
32 位 (x86) 视窗
32bit (x86) Windows
%windir%Microsoft.NETFrameworkv4.0.30319aspnet_regiis.exe -ir
%windir%Microsoft.NETFrameworkv4.0.30319aspnet_regiis.exe -ir
64 位 (x64) 视窗
64bit (x64) Windows
%windir%Microsoft.NETFramework64v4.0.30319aspnet_regiis.exe -ir
%windir%Microsoft.NETFramework64v4.0.30319aspnet_regiis.exe -ir
大卫·默多克评论中的注释:
Note from David Murdoch's comment:
版本已更改因为这个答案已经发布.查看框架的哪个版本%windir%Microsoft.NETFramework64目录并更改命令因此在运行之前(它是当前 v4.0.30319)
That the version has changed since this Answer was posted. Check which version of the framework is in the %windir%Microsoft.NETFramework64 directory and change the command accordingly before running (it is currently v4.0.30319)
更多推荐
IIS 7.5 上的 ASP.NET MVC
发布评论