ASP.Net MVC RTM Gotcha

If you’re like me, you get so excited to check out the RTM of any piece of software you’ve spent the past several months (or more) evaluating, that you dismiss the release notes. Well, this time it cost me. I went to create a new view in Visual Studio, used the new wizard that allows you to strongly type the view, compiled, ran, and ouch! I received the following error:

Parser Error Message: Could not load type 'System.Web.Mvc.ViewPage<Reactor.Data.EventService>'.

Got to love informative ASP.Net exception pages. After doing some digging, I found that in my rush to get the RTM up and running, I overlooked a piece of information that was vital. Apparently, there is an additional configuration block that needs to be added to the web.config file. I’ll save you some trouble of reading the release notes. Add the following attributes to the “pages” element of your web.config:

 

pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

Comments

No Comments