title: CSHTML rendering text only - static page?
body: <p>This is a continuation of my previous question (<a href="https://stackoverflow.com/questions/18193735/cshtml-pages-will-not-render">.CSHTML pages will not render</a>), but I am no longer getting a 500 error, thus the new post. My pages are now just rendering plain text / html (regardless of what I do).<br /></p>
  
  <p>I can get the pages to work correctly if I try to view them through WebMatrix3, but I cannot view them from the browser (either localhost or through the web). </p>
  
  <p>I recently realized that my pages were set up for ASP.NET v2.0, which I am guessing does not support .cshtml. So, I changed everything to v4.0 but I still don't have any luck view the pages correctly. It's just plain text. </p>
  
  <p>I have: <ul>
  <li>MVC 3 installed</li>
  <li>IIS 7.5 on Win7 Home Premium</li>
  <li>The dir of the pages that I want to load converted to application</li>
  <li>web.config functioning, though I am not sure what else, if anything I need to have it in</li>
  <li>My server functioning normally with HTML, .css, .php, python, etc... But I am having horrible luck with any ASP.NET functionality (this includes .aspx). </li>
  </ul></p>
  
  <p>I really don't know what other information I need to put here, but if you ask for it, I shall provide it. </p>
  
  <p><strong>EDIT 1</strong>:<br />
  Now I am just getting 404 errors on any .cshtml page I try to view. This happened before when I didn't have the MIME types in, but was corrected (to at least plain text) when I entered the MIME type in. I have no idea what is going on... at this point I am almost ready to just uninstall everything and try to start over. =\</p>
  
  <p><strong>EDIT 2</strong>:<br />
  Okay, so I have gotten rid of my 404 and 500 errors. I ended up adding a privileged user to the application pool (advanced settings > process model > Identity). It was set as defaultAppPool before. Now I am getting this:</p>
  
  <pre><code>Type 'ASP._Page_default2_cshtml' does not inherit from 'System.Web.WebPages.WebPage'.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  
  Exception Details: System.Web.HttpException: Type 'ASP._Page_default2_cshtml' does not inherit from 'System.Web.WebPages.WebPage'.
  
  Source Error:
  
  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
  
  Stack Trace:
  
  
  [HttpException (0x80004005): Type 'ASP._Page_default2_cshtml' does not inherit from 'System.Web.WebPages.WebPage'.]
     System.Web.UI.Util.CheckAssignableType(Type baseType, Type type) +9633480
     System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +66
     System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(String virtualPath, Type requiredBaseType) +28
     System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType(String virtualPath) +203
     System.Web.WebPages.VirtualPathFactoryExtensions.CreateInstance(IVirtualPathFactory factory, String virtualPath) +145
     System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType(String virtualPath) +153
     System.Web.WebPages.VirtualPathFactoryExtensions.CreateInstance(IVirtualPathFactory factory, String virtualPath) +73
     System.Web.WebPages.WebPageHttpHandler.CreateFromVirtualPath(String virtualPath, IVirtualPathFactory virtualPathFactory) +23
     System.Web.WebPages.WebPageRoute.DoPostResolveRequestCache(HttpContextBase context) +349
     System.Web.WebPages.WebPageHttpModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +89
     System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +69
  </code></pre>
  
  <p>Any more ideas? Oh, and creating a new application didn't help, but it was a good idea. </p>