This project is read-only.

trouble is brewing wiith web pages in 2.5

Topics: Themes
Jul 8, 2012 at 10:23 AM

Let me start out by saying i almost never post to forums since up until the Google Penquin update, things were relatively easy to find on the much for that. Anyway, i am hoping someone could help me out of a jam with blogengine 2.5.

Basically, web pages are compiling when requesting any page with extension ".cshtml" - even a blank page with no content. Here is the error:

namespace ASP {
Line 13:       using System;
Line 14:       using System.Collections.Generic;
Line 15:       using System.IO;
Line 16:       using System.Linq;
Line 17:       using System.Net;
Line 18:       using System.Web;
Line 19:       using System.Web.Helpers;
Line 20:       using System.Web.Security;
Line 21:       using System.Web.UI;
Line 22:       using System.Web.WebPages;
Line 23:       using System.Web.WebPages.Html;
Line 24:       using WebMatrix.Data;
Line 25:       using WebMatrix.WebData;
Line 26:       
Line 27:       
Line 28:       public class _Page_nothing_cshtml {
Line 29:           
Line 30:   #line hidden
Line 31:   
Line 32:           
Line 33:           public _Page_nothing_cshtml() {
Line 34:           }
Line 35:           
Line 36:           protected ASP.global_asax ApplicationInstance {
Line 37:               get {
Line 38:                   return ((ASP.global_asax)(Context.ApplicationInstance));
Line 39:               }
Line 40:           }
Line 41:           
Line 42:           public override void Execute() {
Line 43:   
Line 44:   
Line 45:   
Line 46:           }
Line 47:       }
Line 48:   }

the current content of the "nothing.cshtml" page just contains
   <p>Hello There</p>

So why is this happening? It looks like maybe a partial classes is pulling in the class partials and expects an
override-able method that is not found. Is there a base class that contains the "Execute()" method?
If so, why isn't the compiler detecting this at compile time a a base class inheritance somewhere?

This has been a very pesky problem that has been ongoing for 2 weeks now. I really need a solution to this; otherwise, i can't
hold off much longer and we may be forced to go with Wordpress (not my choice by a few are pushing for it). Although i have had
a very positive experience with, up until now, it's hard to make a case at work when this has been lingering for
several weeks and the web of wonder isn't turning up anything, nothing, nada.

Much thanks in advance
Jul 8, 2012 at 10:53 PM

Looks like your post got messed up by code editor, or you forgot to actually include the error.

Jul 9, 2012 at 4:46 AM

hi rthur - i posted the compiler output above. the error message is listed below

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0115: 'ASP._Page_admin_default_cshtml.Execute()': no suitable method found to override

Source Error:

Line 52:         }
Line 53:         
Line 54:         public override void Execute() {
Line 55: 
Line 56: 


Jul 10, 2012 at 5:59 AM

any suggestions? anyone? this is a very annoying problem that is taking up a bunch of time and preventing the ability to make blog posts. Im sure others are experiencing this issue too...

Jul 10, 2012 at 6:59 AM

This post looks pretty relevant to what you are experiencing:

Jul 10, 2012 at 2:41 PM

hi BenAmada -- thanks for your reply. i looked at the link you mentioned but i don't think that issue mirrors what is happening here. First, i tried adding the section, mentioned in the post and that doesn't help. Also, this isn't a matter of trying to upgrade MVC from version 2 to version 3. Moreover, there is no effort on this end to to attmpt to convert razor views from a previous version. Instead, this is a very simple implementation of and doing nothing more than attempting to access the "dashboard" or the "extensions" tab both of which render .cshtml pages.

Jul 10, 2012 at 4:26 PM

If no .cshtml pages working for you out of the box, say you install BE and accessing any admin .cshtml page gives you an error, then probably this extension is not registered with IIS. Here is an example of what it could be. Otherwise, just give steps you doing so we can follow.

Jul 10, 2012 at 7:36 PM
Edited Jul 10, 2012 at 7:38 PM : I can not access admin .cshtml pages and get 404 error if BE is installed in virtual directory Do not have this error if BE is installed in

BE works fine in virtual directory


Aug 22, 2012 at 8:50 PM

I am getting this same error.  I am able to access the .cshtml pages in my blog when it is hosted in its own web directory, but when I host it as an application in a virtual directory then none of my .cshtml pages work.  The web.config of my parent site is influencing the blog in the virtual directory.  I've narrowed down the problematic web.config statement to the "pages" section of the razor configuration section shown below (from the parent web.config).  If I comment out the pages section in the parent web.config then I can view the dashboard and other .cshtml pages of the blog when hosted in the virtual directory of my main site.  

I've tried <remove/>ing the system.web.webPages.razor sectionGroup in the blog's root web.config but that did not help.  I'm not very familiar with razor so I'm not quite sure how to proceed with this error.  Does anyone else have a suggestion of something to try to resolve my .cshtml issue?

From Parent Web.Config...

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


  <location path="."
      <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <pages pageBaseType="System.Web.Mvc.WebViewPage">
          <add namespace="System.Web.Mvc" />
          <add namespace="System.Web.Mvc.Ajax" />
          <add namespace="System.Web.Mvc.Html" />
          <add namespace="System.Web.Routing" />