开发者

Is the Spark ViewEngine compatible with Glimpse?

开发者 https://www.devze.com 2023-02-27 06:02 出处:网络
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 ru开发者_StackOverflown my site I g

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 ru开发者_StackOverflown 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.

Update

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号