Note that there are some explanatory texts on larger screens.

plurals
  1. POParser Error for Strongly Typed Master Page in MVC 2
    text
    copied!<p>I am trying to create a STRONGLY TYPED Master Page (MVC 2.0) and getting following error: </p> <pre><code>Parser Error Message: Could not load type 'System.Web.Mvc.ViewMasterPage&lt;Resorts.Services.ViewModels.BaseView&gt;'. </code></pre> <p>Here is my code inside Master Page:</p> <pre><code>&lt;%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage&lt;Resorts.Services.ViewModels.BaseView&gt;" %&gt; &lt;%@ Import Namespace="Resorts.Services.ViewModels" %&gt; </code></pre> <p><code>Resorts.Services.ViewModels.BaseView</code> is inside a seperate assembly and its referenced in Master Page. <code>Resorts.Services.ViewModels.BaseView</code> is NOT abstract class.</p> <p>I saw a similar question was asked and resolved here BUT I couldn't figure out the solution:</p> <p><a href="https://stackoverflow.com/questions/860412/parse-error-viewmasterpagetmodel">Parse Error ViewMasterPage&lt;TModel&gt;</a></p> <p>Here is ~Views\Web.Config file which I am not using in any way. Not sure if I need to make any changes inside this. If I delete this file, my Views are throwing parsing errors.</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;httpHandlers&gt; &lt;add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/&gt; &lt;/httpHandlers&gt; &lt;pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt; &lt;controls&gt; &lt;add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" /&gt; &lt;/controls&gt; &lt;/pages&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;validation validateIntegratedModeConfiguration="false" /&gt; &lt;handlers&gt; &lt;remove name="BlockViewHandler"/&gt; &lt;add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /&gt; &lt;/handlers&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>If I do <code>&lt;%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %&gt;</code> in Master everything works fine BUT it doesn't like <code>&lt;%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage&lt;T&gt;" %&gt;</code> :(</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload