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.
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.
This has been fixed in Spark version 1.5.1.6. And is up on NuGet here
All the best,
Rob
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With