title: is there a certain way to configure web.config and make Razor available in ASP.Net 4 normal Web Application?
body: <p>NOT Web Pages Application  - I used VisualStudio 2010 and it is a multi-projects solution.</p>
  
  <p>Now the Web Application is in .Net 4.0 but with over 200+ aspx files in it, today I was just trying to add a few Razor references and see whether it could work - surprisingly it gave me a feeling that it might be possible?</p>
  
  <p>here's the web.config file I made,  however it gave me "This type of page is not served." error. can anyone give me a hand to see if it is possible?</p>
  
  <p>here's my modified web.config</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
        &lt;section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /&gt;
        &lt;section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /&gt;
      &lt;/sectionGroup&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
    &lt;/connectionStrings&gt;
    &lt;appSettings&gt;
      &lt;add key="webpages:Enabled" value="false" /&gt;
    &lt;/appSettings&gt;
    &lt;system.web.webPages.razor&gt;
      &lt;host factoryType="System.Web.WebPages.Razor.WebRazorHostFactory, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;pages pageBaseType="System.Web.WebPages.WebPage"&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.WebPages" /&gt;
          &lt;add namespace="System.Web.WebPages.Html" /&gt;
          &lt;add namespace="System.Web.Helpers" /&gt;
          &lt;add namespace="System.Web.Routing" /&gt;
        &lt;/namespaces&gt;
      &lt;/pages&gt;
    &lt;/system.web.webPages.razor&gt;
    &lt;system.web&gt;
      &lt;httpRuntime requestValidationMode="2.0" maxRequestLength="1048576000" executionTimeout="99999" /&gt;
      &lt;customErrors mode="Off" /&gt;
      &lt;compilation debug="true" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
      &lt;pages validateRequest="false"&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.WebPages" /&gt;
          &lt;add namespace="System.Web.WebPages.Html" /&gt;
          &lt;add namespace="System.Web.Helpers" /&gt;
          &lt;add namespace="System.Web.Routing" /&gt;
        &lt;/namespaces&gt;
      &lt;/pages&gt;
      &lt;httpHandlers&gt;
        &lt;add path="*.cshtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" /&gt;
      &lt;/httpHandlers&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false" /&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"&gt;
        &lt;add name="PBHttpModule" type="WebCider.PortalBuilder.Framework.Web.Http.PBHttpModule, WebCider.PortalBuilder.Framework.Web" /&gt;
      &lt;/modules&gt;
      &lt;directoryBrowse enabled="true" /&gt;
      &lt;security&gt;
        &lt;requestFiltering&gt;
          &lt;requestLimits maxAllowedContentLength="1048576000" /&gt;
          &lt;fileExtensions&gt;
            &lt;add fileExtension=".cshtml" allowed="true" /&gt;
          &lt;/fileExtensions&gt;
        &lt;/requestFiltering&gt;
      &lt;/security&gt;
      &lt;handlers&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
    &lt;runtime&gt;
    &lt;/runtime&gt;
  &lt;/configuration&gt;
  </code></pre>