45

我正在尝试使用 IIS8 将 ASP.NET MVC3 应用程序部署到我的 Windows 8 机器上。当我尝试路由到该站点时,出现以下错误:

HTTP 错误 403.14 - 禁止

我在这个问题上能找到的几乎所有东西都说要运行:

aspnet_regiis.exe -ir

当我在我的 Windows 8 机器上运行它时,我收到以下消息:

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:\Users\Justin>C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe
-ir
Microsoft (R) ASP.NET RegIIS version 4.0.30319.17929
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation.  All rights reserved.
Start installing ASP.NET (4.0.30319.17929) without changing existing web 
applications to use this version of ASP.Net.  This option is not supported on 
this version of the operating system.  Administrators should instead install / 
uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog, 
the Server Manager management tool, or the dism.exe command line tool.  For more 
details please see http://go.microsoft.com/fwlink/?LinkID=216771.
Finished installing ASP.NET (4.0.30319.17929) without changing existing web 
applications to use this version of ASP.Net.

我的系统上已经安装了 ASP.NET 4.5。

Windows功能

我的应用程序在 Visual Studio 中正常运行,但我无法部署它来挽救我的生命。我完全不知道从这里去哪里。我也为此站点尝试了集成和经典管道模式。

4

3 回答 3

41

运行以下命令,它将在 IIS 中安装和注册 ASP.NET 4.5:

dism /online /enable-feature /featurename:IIS-ASPNET45 /all
于 2014-10-14T08:52:22.877 回答
22

我有同样的问题。到目前为止,我只找到了这个论坛帖子,其中一个答案表明通过 Web Platform Installer 安装解决了这个问题,尽管这对我不起作用。IIS ASP.NET 4.5 功能已被禁用,因为它已安装。

更新: 我终于让它工作了。

按照这个 SO question 中的说明在 IIS 中启用 wcf 服务: WCF on IIS8; *.svc 处理程序映射不起作用

这里还有一些关于如何安装处理程序映射的信息

于 2012-10-02T11:43:51.977 回答
2

对我有用的是: - 在删除/添加 Windows 功能中取消选中 4.5 和 3.5 - 重新启动计算机 - 在删除/添加 Windows 功能中选中 4.5 和 3.5。

从那时起,一切都再次奏效。

于 2014-03-11T11:08:59.240 回答