为什么不是cshtml文件渲染iis7.5 windows server 2008

问题描述 投票:2回答:1

因为我已经浪费了5天来解决这个问题与.cshtml asp.net网页我想为什么不问大师。

HTTP错误404.4 - 未找到您要查找的资源没有与之关联的处理程序。详细错误信息模块IIS Web核心通知MapRequestHandler处理程序尚未确定错误代码0x80070002请求的URL xxxxxxxxx:80 / bakery / default.cshtml物理路径xxxxxxxx \ bakery \ default.cshtml登录方法匿名登录用户匿名

<system.webServer>
  <security>
        <requestFiltering>
            <fileExtensions>
                <remove fileExtension=".cshtml" />
                <add fileExtension=".cshtml" allowed="true" />
            </fileExtensions>
        </requestFiltering>
   </security>
    <validation validateIntegratedModeConfiguration="true" />     
<modules runAllManagedModulesForAllRequests="true" />
<handlers accessPolicy="Read, Script, Write, Execute">
    <clear />
    <remove name="cshtml-Integrated-4.0" />
    <remove name="cshtm-Integrated-4.0" />
    <remove name="cshtml-ISAPI-4.0_32bit" />
    <remove name="cshtml-ISAPI-4.0_64bit" />        
    <add name="cshtml-ISAPI-4.0_32bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" resourceType="Unspecified" requireAccess="Script" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
    <add name="cshtml-ISAPI-4.0_64bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" resourceType="Unspecified" requireAccess="Script" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />        
</handlers>
</system.webServer>

记录:是的.NET 4.0安装,这是一个明显的要求,因为这个应用程序的应用程序池设置为“允许32位应用程序”,应用程序池设置为在集成模式下运行。 server:windows server 2008 r2,从上面可以看到runAllManagedModulesForAllRequests =“true”设置为true。所以请不要问我这些愚蠢的问题,那些做过任何故障排除的人都已经做过了。

asp.net razor iis-7.5 webmatrix asp.net-webpages
1个回答
0
投票

我遇到了同样的问题,我使用的是虚拟主机服务器,我通过将所有MVC3和Razor dll复制到bin文件夹来解决了这个问题。

  1. 如果您在“应用程序”中创建Web:右键单击您的Web项目,选择“添加可部署的依赖项”,然后重新生成,然后尝试部署它。
  2. 如果您创建“网站”,而不是应用程序:将这些手动复制到您的bin文件夹中: Microsoft.Web.Infrastructure.dll System.Web.Helpers.dll System.Web.Mvc.dll System.Web.Razor.dll System.Web.WebPages.Deployment.dll System.Web.WebPages.dll System.Web.WebPages。 Razor.dll
© www.soinside.com 2019 - 2024. All rights reserved.