简体   繁体   English

为什么cshtml文件无法呈现iis7.5 Windows Server 2008

[英]why aren't cshtml files rendering iis7.5 windows server 2008

since i've already wasted 5 days on this problem with .cshtml asp.net web pages i figured why not ask the gurus. 因为我已经用.cshtml asp.net网页浪费了5天的时间,所以我想出了为什么不问大师。

HTTP Error 404.4 - Not Found The resource you are looking for does not have a handler associated with it. HTTP错误404.4-找不到您要查找的资源没有与之关联的处理程序。 Detailed Error Information Module IIS Web Core Notification MapRequestHandler Handler Not yet determined Error Code 0x80070002 Requested URL xxxxxxxxx:80/bakery/default.cshtml Physical Path xxxxxxxx\\bakery\\default.cshtml Logon Method Anonymous Logon User Anonymous 详细的错误信息模块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>

for the record: yes .NET 4.0 is installed that is an obvious requirement yest the app pool for this app is set to "allow 32 bit applictions" and the app pool is set to run in integrated mode. 记录:是的,安装了.NET 4.0是一个明显的要求,是,此应用程序的应用程序池设置为“允许32位应用程序”,并且应用程序池设置为在集成模式下运行。 server: windows server 2008 r2 and as you can see from above runAllManagedModulesForAllRequests="true" is set to true. 服务器:Windows Server 2008 r2,从上面可以看到,runAllManagedModulesForAllRequests =“ true”设置为true。 so please don't ask me these silly questions that anyone who that has done any troubleshooting would already have done. 因此,请不要向我问这些愚蠢的问题,即任何进行过故障排除的人都已经做过。

I have met the same problem, i am using a virtual host server, and I solved this with copying all MVC3 and Razor dlls into the bin folder. 我遇到了同样的问题,我使用的是虚拟主机服务器,并且通过将所有MVC3和Razor dll复制到bin文件夹中解决了此问题。

  1. If you create your web in "application": right click your web project, choose "add deployable dependencies", and rebuild again, then try to deploy it. 如果在“应用程序”中创建网站:右键单击您的Web项目,选择“添加可部署的依赖项”,然后再次进行重建,然后尝试部署它。

  2. If you create the "Web Site", not application: Copy these manually into your bin folder: 如果您创建的是“网站”而不是应用程序,请执行以下操作:将这些手动复制到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 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IIS7.5上的网站内部的Javascript无法运行-Windows Server 2008 R2 - Javascript not working inside a website on IIS7.5 - Windows Server 2008 R2 Windows Server 2008 R2 (VPS) 上的 IIS7.5 - POST 请求出现错误 400 - IIS7.5 on Windows Server 2008 R2 (VPS) - Error 400 on POST Request 主机切换到Windows 2008 IIS7.5和HttpHandlers不起作用 - Hosting Switched to Windows 2008 IIS7.5 and HttpHandlers Do Not Work 从Windows 2008 R2 / IIS 7.5移至Windows 2012 / IIS 8.0,网站无法正常运行 - Moved to Windows 2012/IIS 8.0 from Windows 2008 R2/IIS 7.5 and websites aren't working 具有IIS7.5的基于Windows平台的服务器是否支持.htaccess - Does a Windows Platform based server with IIS7.5 support .htaccess 在IIS7.5上的Windows 2008R2上使用Telerik RadCaptcha出现404错误 - 404 error using telerik RadCaptcha on Windows 2008R2 on IIS7.5 在Windows 7上安装IIS7.5之后,所有静态内容文件都将被重定向 - After installing IIS7.5 on windows 7, all static content files get redirected IIS7.5为什么不显示带有URL重写的默认文档? - Why doesn't IIS7.5 show my default document with URL rewriting? Windows Server 2008中IIS 7.5上的Log4Net问题 - Log4Net problem on IIS 7.5 in Windows Server 2008 iis7.5 Windows身份验证提示在远程客户端上显示 - iis7.5 windows authentication prompt shows on remote clients
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM