title: piranah-cms in ASP.NET MVC: Not able to preview
body: <p>I am trying to setup PiranahCMS into my MVC application. I am able to create database and access Admin (Manager section) where one can create pages etc as below:
  <img src="https://i.stack.imgur.com/xKyNT.png" alt="enter image description here"></p>
  
  <p>Once I try to publish the page, I am getting below error:</p>
  
  <p>Server Error in '/' Application.</p>
  
  <hr>
  
  <pre><code>[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Users\harry\AppData\Local\Temp\Temporary ASP.NET Files\root\791319c4\b6685f9c\assembly\dl3\bdf36010\0d3a5a0e_b07ccf01\System.Web.WebPages.Razor.dll'.
  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.InvalidCastException: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Users\harry\AppData\Local\Temp\Temporary ASP.NET Files\root\791319c4\b6685f9c\assembly\dl3\bdf36010\0d3a5a0e_b07ccf01\System.Web.WebPages.Razor.dll'.
  
  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.
  </code></pre>
  
  <p>I am using Visual Studio 2013, MVC 4 and .NET 4.5. 
  Web.config as below:</p>
  
  <p><strong>Have tested with  passiveMove="true"</strong></p>
  
  <pre><code>&lt;settings&gt;
        &lt;managerNamespaces value="" /&gt;
        &lt;disableManager value="false" /&gt;
        &lt;passiveMode value="**false**" /&gt; &lt;!-- Have tested with  passiveMove="true" as well --&gt;
        &lt;prefixlessPermalinks value="false" /&gt;
      &lt;/settings&gt;
      &lt;providers&gt;
        &lt;mediaProvider value="Piranha.IO.LocalMediaProvider, Piranha" /&gt;
        &lt;mediaCacheProvider value="Piranha.IO.LocalMediaCacheProvider, Piranha" /&gt;
        &lt;cacheProvider value="Piranha.Cache.WebCacheProvider, Piranha" /&gt;
        &lt;logProvider value="Piranha.Log.LocalLogProvider, Piranha" /&gt;
      &lt;/providers&gt;
    &lt;/piranha&gt;&lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;serviceAuthorization serviceAuthorizationManagerType="Piranha.Web.APIKeyAuthorization, Piranha" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" /&gt;
    &lt;/system.serviceModel&gt;&lt;connectionStrings&gt;
      &lt;!--    &lt;add name="piranha-ce" connectionString="data source=|DataDirectory|Piranha.sdf" providerName="System.Data.SqlServerCe.4.0" /&gt;
          &lt;add name="piranha-express" connectionString="data source=.\sqlexpress;initial catalog=piranha-db;user id=user;password=pass;multipleactiveresultsets=true;" providerName="System.Data.SqlClient" /&gt;
          &lt;add name="piranha-local" connectionString="data source=(localdb)\v11.0;initial catalog=piranha-db;integrated security=true" providerName="System.Data.SqlClient" /&gt;
          --&gt;
      &lt;add name="piranha" connectionString="data source=VAIO;initial catalog=piranha-db;multipleactiveresultsets=true;Integrated Security=True;"   providerName="System.Data.SqlClient"  /&gt;
      &lt;/connectionStrings&gt;&lt;/configuration&gt;
  </code></pre>
  
  <p>What wrong I am doing here? </p>
  
  <p>Please let me know in-case any other information is needed.</p>
  
  <p>Cheers</p>