83

使用 Oracle 的免费 VirtualBox 应用程序运行 Microsoft Server 2012 RC。在 VirtualBox 设置中使用了桥接网络适配器类型。安装AD和DNS,IIS。在 IIS 选项下的管理工具下,单击管理服务框。这让我可以使用 Visual Studio 2012 RC 中的“Web Deploy”功能。在来宾操作系统上,我运行 Windows 7 Ultimate。

我能够成功地将 MVC 4 应用程序部署到 IIS 默认网站,但它没有显示。相反,默认的 IIS 主页是。我禁用了默认主页并刷新页面显示 403 页面。我尝试输入其中一个视图并显示 404 页面。

4

3 回答 3

31

I spent 2 days trying to find a solution to this, and finally did. Wanted to share with the community in case it helps anyone else.

All the articles and forum messages I ran across on the Internet started to mirror each other in one form or another.

One solution talked about making sure you have the right Application Pool configuration, using 4.0 framework and integrated. [x] Confirmed already set correctly.

Another solution extended direction to use "aspnet_regiis -i" or "aspnet_regiis -ir" which doesn't work on Microsoft Server 2012.

Another solution talked about adding the following to the web.config:

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

However, IIS 8 serves up a response to this saying something to the effect those settings are locked from a higher configuration level and can't be used at the Application level. Meh, ok.

I ultimately tracked down an article that lead me to the following page: http://learn.iis.net/page.aspx/1097/iis-80-using-aspnet-35-and-aspnet-45

The solution was to go back to the Microsoft Server 2012 Dashboard and select the "Add Roles" feature. Scroll down to the root "Web Server (IIS)", expand "Web Server", expand "Application Development" and select "ASP.NET 3.5" and "ASP.NET 4.5" and "Install".

What confused me originally was I hadn't expanded "Application Development", but selected IIS and continued. On the next step, "Features", ".NET Framework 4.5 Features" was selected by default so I selected ".NET Framework 3.5 Features" and thought all would be fine.

After installing the selections under "Application Development", the MVC 4.5 Applications work just the way they were designed. I hope this helps anyone who may have become stuck, like I was.

于 2014-12-17T01:58:22.923 回答
0

您只需在 web config 中将编译调试模式更改为 true 并保持其他属性相同。打开您的发布文件夹并打开 Web Config 文件。

<configuration> <compilation debug="true"> </compilation> </configuration>

于 2019-05-23T10:17:45.323 回答
0

我选择了“.NET Framework 3.5 Features”,并认为一切都会好起来的!!!没有其他行动没有帮助。当这个问题“突然”出现时。有一段时间一切正常。但在下一次发布后,该应用程序运行了几分钟,然后进入错误 403.14

于 2016-01-27T19:47:35.283 回答