*.cshtml files return html error 404 in BlogEngine.NET 2.5

I was searching for some help on this error for days. Tried adding different mappings. Then I found this page :

http://www.sven-s.de/post/BlogEngine-HTTP-4043-cshtml-Handler-not-registered-in-Shared-Hosting.aspx

 “

HTTP Error 404.3 – Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

The solution is, to add the following handlers to web.config:

<system.webServer>
  <handlers>
    <add name="cshtml-ISAPI-4.0_32bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" 
         modules="IsapiModule" 
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" modules="IsapiModule"
scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> <add name="cshtml-Integrated-4.0" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler"
preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer>

Added this settings to the web.config file in the admin folder and “Wham bam thank you…….”. Now it it works.

 

Atle

Leave a Reply