ASP.NET MVC 4网站无法下载JavaScripts

时间:2016-04-19 11:54:25

标签: asp.net-mvc-4 deployment iis-7.5

我在本地有一个正确的ASP.NET MVC 4(.NET Framework 4.5.6)网站。它在VS 2015和Windows 7的IIS 7下运行良好。

当我将同一文件夹部署到MS WIn Server 2008 R2时,它无法正常工作,我遇到了很多错误。请检查日志。

有任何线索如何解决?

enter image description here

1 个答案:

答案 0 :(得分:0)

我可以使用以下步骤修复它

  1. 使用菜单RUN重新注册.NET Framework 4
  2.   

    %windir%\ Microsoft.NET \ Framework \ v4.0.30319 \ aspnet_regiis.exe -ir

         

    %windir%\ Microsoft.NET \ Framework64 \ v4.0.30319 \ aspnet_regiis.exe -ir

    1. 使用MS Web Platform工具
    2. 安装“推荐的配置IIS 7.0”

      enter image description here

      1. 将此代码添加到 web.config
      2. modules部分
         <system.webServer>
            <modules  runAllManagedModulesForAllRequests="true" >
               <remove name="UrlRoutingModule-4.0" />
              <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
            </modules>