This Page is Not Served

Topics: Business Logic Layer
Apr 18, 2011 at 1:30 AM

I downloaded latest version of BE 2.0.0.49 and I am getting the message above, both with Visual Studio 2010 and with godaddy, with the explanation "The type of page you have requested is not served because it has been explicitly forbidden.  The extension '.cshtml' may be incorrect.", when I try to access Extensions...

All my settings are .net 4.0.

What do I need to do to render cshtml pages?

Thanks a lot....

Aug 7, 2011 at 7:39 AM
Edited Aug 7, 2011 at 8:48 AM

Did you resolve this one? I've run into the same error (running it as a virtual application sub-directory, so it's likely inheriting something wrong, but I can't seem to pinpoint it).

 

IIS 7.5
ASP.NET 4.0
Integrated pipeline.

 

And yes, have MVC 3 installed. *.cshtml integrated is mapped to HttpForbiddenHandler, but that's the default so...

 

Aug 7, 2011 at 8:48 AM

 

Turns out I had a buildprovider in the root application that was hijacking that default buildProvider for razor. Updated that with:

                <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
            <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
        </sectionGroup>

...

<buildProviders>
        <remove extension=".cshtml" />
        <remove extension=".vbhtml" />
        <remove extension=".razor" />
        <add extension=".cshtml" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/>
<add extension=".vbhtml" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/>
<add extension=".razor" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/>
</buildProviders>