Tuesday, December 22, 2009

Spark View Engine not compatible with Microsoft MVC 2.0 RC

I was getting the following error when I tried to run a MVC 2 RC project with the Spark View Engine.

Method not found: ‘Void System.Web.Mvc.ViewContext..ctor(System.Web.Mvc.ControllerContext, System.Web.Mvc.IView, System.Web.Mvc.ViewDataDictionary, System.Web.Mvc.TempDataDictionary)’.

The solution was to uninstall the MVC 2 RC and the Spark View Engine, then install the MVC 2 Beta and Spark View Engine.  At that point the project worked fine.

It may be fine to skip the uninstalling and re-installing the Spark View Engine.  I did it just to ensure the best possible outcome, but I suspect it was not really necessary.

By the way, I highly recommend using the Spark View Engine in your MVC projects.  The Spark View markup is much cleaner, easier to write, and easier to maintain.  I am a big fan of this alternative view engine.

Hope that helps.

Joe Kunk
Microsoft MVP
Okemos, MI USA

2 comments:

Dušan said...

Thank you, I lost 3 hours prior to reading your post.

Jay said...

thank you so much for your help!!!