Spark View Engine with asp.net mvc beta

9 views
Skip to first unread message

subnus

unread,
Oct 16, 2008, 5:19:14 PM10/16/08
to Spark View Engine Dev
i got a error when using spark with the new asp.net mvc beta

used google translate to translate from danish to english

Method 'Release View' of type 'Spark.Web.Mvc.SparkViewFactory' from
assembly 'Spark.Web.Mvc, Version = 1.0.0.0, Culture = neutral,
PublicKeyToken = null' is not implemented.
Description: There was an exception, which was not addressed, in the
performance of the current web request. See stack tracking for more
information about the error and where it came from the code.

Details exception: System.TypeLoadException: Method 'Release View' of
type 'Spark.Web.Mvc.SparkViewFactory' from assembly 'Spark.Web.Mvc,
Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null' is not
implemented.

Source Error:


Line 41: engines.Add (new Spark View Factory (settings));
Line 42:
Line 43:)
Line 44:
Line 45: public static void Register Routes (Route Collection routes)


Source: D: \ Development \ Own code \ Private \ Subnus.net MVC \
Subnus.Web \ global.c Line: 43

Stack Tracking:


[TypeLoadException: Method 'Release View' of type
'Spark.Web.Mvc.SparkViewFactory' from assembly 'Spark.Web.Mvc, Version
= 1.0.0.0, Culture = neutral, PublicKeyToken = null' is not
implemented.]
Subnus.MVC.Web.Global.RegisterViewEngine (View Engine Collection
engines) in D: \ Development \ Own code \ Private \ Subnus.net MVC \
Subnus.Web \ global.c: 43
Subnus.MVC.Web.Global.Application_Start () in D: \ Development \
Own code \ Private \ Subnus.net MVC \ Subnus.Web \ Global.asax.cs: 28

subnus

unread,
Oct 16, 2008, 6:56:48 PM10/16/08
to Spark View Engine Dev
it looks like ViewEngineResult have change it constructor so i now
need a IView and IViewEngine

and SparkViewFactory needs to implante public void
ReleaseView(ControllerContext controllerContext, IView view)


and in SparkView line 83-84
var wrapped = new ViewContext(httpContext, viewContext.RouteData,
viewContext.Controller,
viewContext.ViewName,
viewContext.ViewData, viewContext.TempData);

needs to change to
var wrapped = new ViewContext(httpContext, viewContext.RouteData,
viewContext.Controller,
viewContext.View,
viewContext.ViewData, viewContext.TempData);

Louis DeJardin

unread,
Oct 16, 2008, 8:32:18 PM10/16/08
to spar...@googlegroups.com
Tak, Subnus, for the alert. New download is posted for the asp.net beta. http://sparkviewengine.com/download

Some of those ViewContext changes are inconvenient, but after switching a few things around it looks like everything is compatible with Preview 5. Or at least all of the tests still pass.

Something to watch out for - you might need to add the namespace "System.Web.Mvc.Html". It looks like some of the extension methods have moved.

Chris Canal

unread,
Oct 17, 2008, 11:33:31 AM10/17/08
to spar...@googlegroups.com
The extension methods have moved, the release notes has everything covered.  Waiting for MvcContrib to move to Beta 1 then I'll try it out.  Will let you know if I come across any problems.
--
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
-Martin Fowler et al, Refactoring: Improving the Design of Existing Code
Reply all
Reply to author
Forward
0 new messages