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

2

since i've already wasted 5 days on this problem with .cshtml asp.net web pages i figured why not ask the gurus.

HTTP Error 404.4 - Not Found The resource you are looking for does not have a handler associated with it. 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

<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. server: windows server 2008 r2 and as you can see from above runAllManagedModulesForAllRequests="true" is set to true. so please don't ask me these silly questions that anyone who that has done any troubleshooting would already have done.

asp.net
razor
iis-7.5
webmatrix
asp.net-webpages
asked on Stack Overflow Jul 1, 2012 by user1494864

1 Answer

0

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.

  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.

  2. If you create the "Web Site", not application: Copy these manually into your bin folder:

    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

answered on Stack Overflow Jul 2, 2012 by Edi Wang

User contributions licensed under CC BY-SA 3.0