如何在64位系统IIS7下运行MVC网站 The steps need to check when you want to run a MVC site under 64 bit OS+IIS7

本文提供了一系列检查步骤和解决方案,帮助开发者解决部署MVC网站到64位操作系统和IIS7时遇到的异常问题。包括确保安装必要的IIS特性、.NET框架、ASP.NET MVC、Rewrite模块、正确注册ASP.NET、授权设置、配置web.config文件等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

If you deploy your MVC site under a 64 bit OS + IIS7, you may offen encount exceptions, I just collect the gerernal list & steps to check when fix those exceptions based on my personal experiences:

1. Make sure the iis requried features have been installed, you can select all the features to intall.

2. Make sure the .net framework and asp.net mvc installed, please pay attention the version, the asp.net mvc 3 must have .net framework 4 installed; the asp.net mvc 2 must have .net framework 3.5 sp1 installed. You can go to the Microsoft official site to download those.

3. Make sure the rewrite module installed if you use rewrite feature in the app and has rewrite section in your web.config, note there are rewrite_2.0_rtw_x86.msi and rewrite_2.0_rtw_x64.msi versions, you can also get them from google search.

4. Make sure the asp.net registerred correctly, note that there are sequence issue during IIS+VisualStudio+framework installation, use cmd line to re-registerred the asp.net, for instance if mvc 3 + framework 4, the cmds: <windows dir>\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe /ir and <windows dir>\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe /ir

5. Make sure the authorization has been set correctly, if you use framework 4 you must set the app pool framework version to 4, note a site not support different version of .net apps, and set the app pool account to proper one, the account must have the required DBs permission.

5. Rebuild your solution

6. Restart your IIS

7. Make sure the web.config been configured correctly, below is required for mvc3

<compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值