Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the Spark ViewEngine compatible with Glimpse?

Just came across the glimpse tool (getglimpse.com) and would like to try it out on my Spark-powered site (VS2010, MVC3), but come unstuck at the first hurdle. When I run my site I get the following error:

Unable to cast object of type 'Glimpse.Net.Plumbing.GlimpseView' to type 'Spark.ISparkView'.

Don't know whether this is a Glimpse issue or a Spark issue, but would like to get it sorted since Glimpse looks like a cool tool.

like image 360
kenxl Avatar asked Apr 19 '11 14:04

kenxl


2 Answers

It's because GlimpseView inherits from IView in the System.Web.Mvc namespace, and so does the ISparkView interface. At the time Spark renders the view after finding it, it compiles and renders on the fly, casting it to ISparkView so that it can attach the Model and do some other bits.

I suppose Glimpse is intercepting the view creation step and using it's own type assuming that anything that inherits from IView is fine. I guess some kind of adapter can be built to handle Glimpse views as that happens to be once of the extensibility points of Spark.

Sorry it doesn't help much, but at least it explains your exception.

Update

This has been fixed in Spark version 1.5.1.6. And is up on NuGet here

All the best,
Rob

like image 153
RobertTheGrey Avatar answered Nov 15 '22 08:11

RobertTheGrey


I'm one of the founder's of glimpse. Would it be possible to share a bit more about your situation?

I've not used Spark before, but from my understanding this should all work since everything is programmed to interfaces. Are you registering Spark as your view engine in the app start?

We have a support/issues forum at https://github.com/Glimpse/Glimpse/issues if you need more help as well.

like image 38
nikmd23 Avatar answered Nov 15 '22 08:11

nikmd23