ASP.NET MVC 3部署403错误的Windows Server 2008 R2上 [英] ASP.NET MVC 3 Deployment 403 Error on Windows Server 2008 R2

查看:72
本文介绍了ASP.NET MVC 3部署403错误的Windows Server 2008 R2上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我部署MVC3应用到新的服务器。该应用程序运行开发服务器(Visual Studio中),并在IIS7我的开发机器上很好,但在服务器上我得到一个403错误:

I'm deploying an MVC3 application to a new server. The application runs fine on the development server (Visual Studio) and also under IIS7 on my development machine, but on the server I get a 403 error:

我已经完成了下列步骤,但​​现在我的想法。请帮助!

I have completed the following steps, but am now out of ideas. Please help!


  • 使用我自己的计算机上使用相同的Xcopy部署的技术,我已经部署文件到该服务器,并增加了以下文件夹的权限:

IUSR - 读取和放大器;执行,列出文件夹目录,读取
IIS_IUSRS - 读取和放大器;执行,列出文件夹目录,读取

IUSR - Read & execute, List folder contents, Read IIS_IUSRS - Read & execute, List folder contents, Read


  • 我也对服务器,以便其他所需的.dll安装ASP.NET MVC3在GAC

  • I have also installed ASP.NET MVC3 on server so additional required .dlls are in GAC

IIS设置,我可以访问基本的HTML文件(如,我在现场的路线下降的test.html文件)。

IIS is set up and I can access basic html files (such as test.html that I have dropped in at the site route).

我在服务器管理器已经检查的所有角色服务都安装

I have checked in Server Manager that all Role Services are installed

必须通过从MVC复制文件的安装位置,并把bin目录试图斌部署

Have attempted to bin deploy by copying files from MVC install location and putting in the bin directory

C:\\ Program Files文件(x86)的\\微软ASP.NET \\ ASP.NET MVC 3 \\组件

C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies

C:\\ Program Files文件(x86)的\\微软ASP.NET \\ ASP.NET网页\\ 1.0 \\组件

C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies

推荐答案

好吧,发现了问题。这是柜面其他人有同样的问题:

Ok, found the problem. Here it is incase anyone else has the same issue:

我使用的服务器必须有.NET 4 IIS之前安装。这意味着.NET 4中没有登记与IIS。

The Server I'm using must have had .NET 4 installed before IIS. This meant that .NET 4 hadn't been registered with IIS.

我检查IIS配置时发现的问题。点击该网站的.NET编译图标抛出一个异常,presumably,因为应用程序无法进行编译。

I noticed the issue when checking IIS config. Clicking the .NET compilation icon for the website threw an exception, presumably because the application could not be compiled.

这使我的指示我hanselman.com

This led me to a stack overflow post that directed me to hanselman.com

总之,我不得不在服务器上使用IIS在命令行安装VS2010,所以我不得不使用Visual Studio命令提示符,然后注册.NET 4。

In short, I had to install VS2010 on the server so I had the Visual Studio command prompt available, and then register .NET 4 with IIS on the command line.

<一个href=\"http://stackoverflow.com/questions/3738559/iis-manager-cant-configure-net-compilation-on-net-4-applications\">IIS经理不能在.NET配置.NET编译4应用程序

http://www.hanselman.com/blog/ASPNET4BreakingChangesAndStuffToBeAwareOf.aspx

关键部分:

我安装ASP.NET 4,然后
安装IIS。

"I installed ASP.NET 4 and then installed IIS."

如果您安装VS2010和/或.NET 4
第一,以后再安装IIS,你
需要确保IIS配置为
了解ASP.NET 4否则IIS
将不知道如何运行ASP.NET 4
应用程序。

If you install VS2010 and/or .NET 4 first, then later install IIS, you need make sure IIS is configured to know about ASP.NET 4 otherwise IIS will have no idea how to run ASP.NET 4 applications.

有一个简单的解决方法

如果您已经在此状态下,降
  到命令行并导航到
  外汇安装目录。然后运行
  aspnet_regiis的-iru。

If you are already in this state, drop to the command line and navigate to the FX install directory. Then run "aspnet_regiis –iru".

请注意,如果你是一个64位的机器上,
  从64位FX运行这个命令
  安装目录 - 而不是32位
  安装目录。

Note if you are on a 64-bit machine, run this command from the 64-bit FX install directory – not the 32-bit installation directory.

或以供将来参考,尝试启用
  IIS和AS​​P.NET扩展性
  选项​​的第一个的,当你正在建设
  机或虚拟机。这样,当VS
  2010或.NET随后
  安装,安装会
  自动检测的presence
  它和IIS会自动注册。

or for future reference, try to enable IIS and the ASP.NET extensibility option first when your are building machines or VMs. That way when VS 2010 or .NET are subsequently installed, the installation will automatically detect the presence of IIS and will auto-register with it.

这篇关于ASP.NET MVC 3部署403错误的Windows Server 2008 R2上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆