I am trying to create a STRONGLY TYPED Master Page (MVC 2.0) and getting following error:
Parser Error Message: Could not load type 'System.Web.Mvc.ViewMasterPage<Resorts.Services.ViewModels.BaseView>'.
Here is my code inside Master Page:
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<Resorts.Services.ViewModels.BaseView>" %>
<%@ Import Namespace="Resorts.Services.ViewModels" %>
Resorts.Services.ViewModels.BaseView
is inside a seperate assembly and its referenced in Master Page. Resorts.Services.ViewModels.BaseView
is NOT abstract class.
I saw a similar question was asked and resolved here BUT I couldn't figure out the solution:
Parse Error ViewMasterPage<TModel>
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.
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<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">
<controls>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
If I do <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
in Master everything works fine BUT it doesn't like <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<T>" %>
:(