5

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.

nikmd23
  • 9,095
  • 4
  • 42
  • 57
kenxl
  • 319
  • 1
  • 4
  • 13

2 Answers2

4

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

Community
  • 1
  • 1
RobertTheGrey
  • 8,645
  • 5
  • 32
  • 45
  • RobertTheGrey and Iworked together to come up with a solution to this. The newest versions of Spark do not that this issue anymore. Glimpse and Spark together at last! – nikmd23 May 09 '11 at 13:59
1

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.

nikmd23
  • 9,095
  • 4
  • 42
  • 57
  • Hi - thanks for the res;ponse. Just noticed that this issue at the Glimpse github (https://github.com/Glimpse/Glimpse/issues/20) is exactly the same as the one I have (same versions of software, etc), so I'll follow progress there. – kenxl Apr 20 '11 at 08:56