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>

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

被折叠的 条评论
为什么被折叠?



