Commented Issue: MVC2RC breaks latest version [4936]

7 views
Skip to first unread message

sparkviewengine Issue Tracker Rss Feed

unread,
Jan 15, 2010, 10:42:02 AM1/15/10
to spar...@googlegroups.com
Using the latest version (with the MVC2 support) and upgrading to MVC2 RC causes Spark to crash - it looks like an extra TextWriter parameter was added to the ViewContext constructor. I tried updating the source and recompiling, but I got failing tests, and I'm afraid I don't know enough about the code to be able to fix them...

Thanks
Matt
Comments: ** Comment from web user: ArnisL **

Thanks, kastermester!

URL: http://sparkviewengine.codeplex.com/WorkItem/View.aspx?WorkItemId=4936

sparkviewengine Issue Tracker Rss Feed

unread,
Jan 15, 2010, 1:42:03 PM1/15/10
to spar...@googlegroups.com
Using the latest version (with the MVC2 support) and upgrading to MVC2 RC causes Spark to crash - it looks like an extra TextWriter parameter was added to the ViewContext constructor. I tried updating the source and recompiling, but I got failing tests, and I'm afraid I don't know enough about the code to be able to fix them...

Thanks
Matt
Comments: ** Comment from web user: ali62b **

Spark crashed MVC 2 RC :(

URL: http://sparkviewengine.codeplex.com/WorkItem/View.aspx?WorkItemId=4936

Alex Henning Johannessen

unread,
Jan 15, 2010, 8:52:47 PM1/15/10
to spar...@googlegroups.com
You can fix it by introducing this:

using System.Web.Mvc;
using System.IO;

namespace Spark.Web.Mvc.Wrappers
{
internal class ViewContextWrapper : ViewContext
{
private readonly SparkViewBase sparkView;
internal ViewContextWrapper(ControllerContext
controllerContext, IView view, SparkViewBase sparkView,
ViewDataDictionary viewData, TempDataDictionary tempData)
: base(controllerContext, view, viewData, tempData, new
StringWriter())
{
this.sparkView = sparkView;
}

public override TextWriter Writer
{
get
{
return sparkView.Output ?? base.Writer;
}
}
}
}

in the Spark.Web.Mvc2 project, and then on line 142 in the Render
method in SparkView.cs add this:

...
var wrappedViewContext = new ViewContextWrapper(
new ControllerContext(wrappedHttpContext,
viewContext.RouteData, viewContext.Controller),
viewContext.View,
this,
viewContext.ViewData,
viewContext.TempData);
...

If you use .Net4 you should probably do the following.

Add this to AssemblyInfo.cs in Spark.Web.Mvc2:


[assembly: SecurityRules(SecurityRuleSet.Level1)]


If you are targeting .Net4, then you can go into the compiler and
change its target to v4.0:

...
var providerOptions = new Dictionary<string, string> {
{ "CompilerVersion", "v4.0" } };
...

in BatchCompiler.cs in the Spark project.

And then change the System.Web.Routing, System.Web.Abstractions and
System.Web references to the corresponding .Net4 versions.

I hope this helps,
ahjohannessen

> --
> You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
> To post to this group, send email to spar...@googlegroups.com.
> To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.
>
>
>
>

ba...@bertus.com

unread,
Jan 19, 2010, 4:51:37 AM1/19/10
to Spark View Engine Dev
Thanks Alex,

your solution is working for me but I had to fix some tests too.
Let's hope there will be a new release soon which supports MVC 2 RC.
The latest commit is from November 7, that's a long time ago.

Bas

AHJohannessen

unread,
Jan 20, 2010, 5:53:53 AM1/20/10
to Spark View Engine Dev
On Jan 19, 9:51 am, "b...@bertus.com" <b...@bertus.com> wrote:
> Thanks Alex,

No problem, glad to help :)

> The latest commit is from  November 7, that's a long time ago.

It sure is, wonder why. I guess Louis has a lot on his mind with his
new job at MS and such. Louis, we need some Spark love, you hear me! ;)

Louis DeJardin

unread,
Jan 20, 2010, 10:16:42 PM1/20/10
to Spark View Engine Dev
Yeah! What the heck's up with the delay?

:\

Phil Haack

unread,
Jan 20, 2010, 10:28:16 PM1/20/10
to <spark-dev@googlegroups.com>, Spark View Engine Dev
Get on the ball Louis!

Sent from my mobile phone

On Jan 20, 2010, at 7:17 PM, "Louis DeJardin"
<louis.d...@gmail.com> wrote:

Josh Close

unread,
Jan 21, 2010, 9:22:49 AM1/21/10
to spar...@googlegroups.com
Yeah, and add full Visual Studio integration with full intellisense support while you're at it! Slacker! :P

Seriously though Phil, spark should be a part of the MVC release and be supported like jQuery is. :)

Chris Missal

unread,
Jan 21, 2010, 9:53:07 AM1/21/10
to spar...@googlegroups.com
+100 to Josh's statement :)
--
Chris Missal
http://chrismissal.lostechies.com/

Phil Haack

unread,
Jan 21, 2010, 12:09:06 PM1/21/10
to spar...@googlegroups.com

I’d love to see that happen too at some point. Is anyone here willing to help out? J

 

Having this happen for ASP.NET MVC 2 is probably not going to happen “in the box”. However, I’ve been working with Louis to take baby steps towards that and provide an experience that is better than we have now.

 

We could use some help.

 

I mentioned on Twitter that we’re going to make a change to the Add View scaffolding so that you can control the file extension of the generated view. I had Spark (and other view engines) in mind with that.

 

If you’ve been playing around with ASP.NET MVC 2 RC, maybe you can help me convert our existing T4 templates to produce Spark output. What I’m working towards is having a Spark installer available in our Web Platform Installer that would make it trivially easy to add Spark to ASP.NET MVC after the fact. It’s not “in the box” but it’s pretty darn close.

 

Phil

sasha revzin

unread,
Jan 21, 2010, 1:00:01 PM1/21/10
to spar...@googlegroups.com
need u help with T4?
for me, it simply replace standard tags to spark syntax 
kind of black job :-D

scalvert

unread,
Jan 21, 2010, 2:57:23 PM1/21/10
to Spark View Engine Dev
I'd be willing to help with the conversion of the tt files to spark.
It's real easy. I'm doing the Empty.tt template as we speak.

On Jan 21, 9:09 am, Phil Haack <phi...@microsoft.com> wrote:
> I'd love to see that happen too at some point. Is anyone here willing to help out? :)


>
> Having this happen for ASP.NET MVC 2 is probably not going to happen "in the box". However, I've been working with Louis to take baby steps towards that and provide an experience that is better than we have now.
>
> We could use some help.
>
> I mentioned on Twitter that we're going to make a change to the Add View scaffolding so that you can control the file extension of the generated view. I had Spark (and other view engines) in mind with that.
>
> If you've been playing around with ASP.NET MVC 2 RC, maybe you can help me convert our existing T4 templates to produce Spark output. What I'm working towards is having a Spark installer available in our Web Platform Installer that would make it trivially easy to add Spark to ASP.NET MVC after the fact. It's not "in the box" but it's pretty darn close.
>
> Phil
>
> From: spar...@googlegroups.com [mailto:spar...@googlegroups.com] On Behalf Of Chris Missal
> Sent: Thursday, January 21, 2010 6:53 AM
> To: spar...@googlegroups.com
> Subject: Re: Commented Issue: MVC2RC breaks latest version [4936]
>
> +100 to Josh's statement :)
>

> On Thu, Jan 21, 2010 at 8:22 AM, Josh Close <nar...@gmail.com<mailto:nar...@gmail.com>> wrote:
>
> Yeah, and add full Visual Studio integration with full intellisense support while you're at it! Slacker! :P
>

> Seriously though Phil, spark should be a part of the MVC release and be supported like jQuery is. :)On Wed, Jan 20, 2010 at 9:28 PM, Phil Haack <phi...@microsoft.com<mailto:phi...@microsoft.com>> wrote:
>
> Get on the ball Louis!
>
> Sent from my mobile phone
>
> On Jan 20, 2010, at 7:17 PM, "Louis DeJardin"
>
>
>
> <louis.dejar...@gmail.com<mailto:louis.dejar...@gmail.com>> wrote:
> > Yeah! What the heck's up with the delay?
>
> > :\
>

> > On Jan 20, 2:53 am, AHJohannessen <ahjohannes...@gmail.com<mailto:ahjohannes...@gmail.com>> wrote:


> >> On Jan 19, 9:51 am, "b...@bertus.com<mailto:b...@bertus.com>" <b...@bertus.com<mailto:b...@bertus.com>> wrote:
>
> >>> Thanks Alex,
>
> >> No problem, glad to help :)
>
> >>> The latest commit is from  November 7, that's a long time ago.
>
> >> It sure is, wonder why. I guess Louis has a lot on his mind with his
> >> new job at MS and such. Louis, we need some Spark love, you hear
> >> me! ;)
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Spark View Engine Dev" group.

> > To post to this group, send email to spar...@googlegroups.com<mailto:spar...@googlegroups.com>.
> > To unsubscribe from this group, send email to spark-dev+...@googlegroups.com<mailto:spark-dev%2Bunsu...@googlegroups.com>
> > .


> > For more options, visit this group athttp://groups.google.com/group/spark-dev?hl=en
> > .
>
> --
>

> You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.

> To post to this group, send email to spar...@googlegroups.com<mailto:spar...@googlegroups.com>.
> To unsubscribe from this group, send email to spark-dev+...@googlegroups.com<mailto:spark-dev%2Bunsu...@googlegroups.com>.
> For more options, visit this group athttp://groups.google.com/group/spark-dev?hl=en.


>
> --
> You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.

> To post to this group, send email to spar...@googlegroups.com<mailto:spar...@googlegroups.com>.
> To unsubscribe from this group, send email to spark-dev+...@googlegroups.com<mailto:spark-dev%2Bunsu...@googlegroups.com>.


> For more options, visit this group athttp://groups.google.com/group/spark-dev?hl=en.
>
> --

> Chris Missalhttp://chrismissal.lostechies.com/

Adam Schroder

unread,
Jan 21, 2010, 3:50:07 PM1/21/10
to spar...@googlegroups.com
The intellisense for VS2010 is the big one i think. Having full support would be awesome. Unfortunately I have no idea where to start otherwise would be glad to help.

To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.

Phil Haack

unread,
Jan 21, 2010, 5:03:23 PM1/21/10
to spar...@googlegroups.com

Louis has already done a lot of work on Intellisense. However, the real challenge is dual intellinese. What I mean is if you want Spark code instellisense, you lose HTML intellisense. If you want HTML intellisense, you lose Spark intellisense.

 

Getting both at the same time is a huge challenge. I have no idea either. I’ve tried talking to people on the Visual Studio team but they’ve been understandably very busy lately.

 

Phil

Adam Schroder

unread,
Jan 21, 2010, 5:16:59 PM1/21/10
to spar...@googlegroups.com
Yeah. You need to be able to extend the current HTML intellisense adding in sparkness, not replace it. 

ste...@vanterpool.net

unread,
Jan 21, 2010, 5:20:36 PM1/21/10
to Spark View Engine Dev
To be quite honest, I can live without intellisense for html. No spark
intellisense is the only thing keeping me from using vs 2010 for my
day to day.

On Jan 21, 2:16 pm, Adam Schroder <adamschro...@gmail.com> wrote:
> Yeah. You need to be able to extend the current HTML intellisense adding in
> sparkness, not replace it.
>
>
>
> On Fri, Jan 22, 2010 at 9:03 AM, Phil Haack <phi...@microsoft.com> wrote:
> >  Louis has already done a lot of work on Intellisense. However, the real
> > challenge is dual intellinese. What I mean is if you want Spark code
> > instellisense, you lose HTML intellisense. If you want HTML intellisense,
> > you lose Spark intellisense.
>
> > Getting both at the same time is a huge challenge. I have no idea either.
> > I’ve tried talking to people on the Visual Studio team but they’ve been
> > understandably very busy lately.
>
> > Phil
>

> > *From:* spar...@googlegroups.com [mailto:spar...@googlegroups.com] *On
> > Behalf Of *Adam Schroder
> > *Sent:* Thursday, January 21, 2010 12:50 PM
>
> > *To:* spar...@googlegroups.com
> > *Subject:* Re: Commented Issue: MVC2RC breaks latest version [4936]


>
> > The intellisense for VS2010 is the big one i think. Having full support
> > would be awesome. Unfortunately I have no idea where to start otherwise
> > would be glad to help.
>

> > spark-dev+...@googlegroups.com<spark-dev%2Bunsubscribe@googlegroups­.com>
> > <mailto:spark-dev%2Bunsu...@googlegroups.com<spark-dev%252Bunsubscribe@­googlegroups.com>


>
> > > > .
> > > > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en
>
> > > > .
>
> > > --
>
> > > You received this message because you are subscribed to the Google Groups
> > "Spark View Engine Dev" group.
>
> > > To post to this group, send email to spar...@googlegroups.com<mailto:
> > spar...@googlegroups.com>.
> > > To unsubscribe from this group, send email to

> > spark-dev+...@googlegroups.com<spark-dev%2Bunsubscribe@googlegroups­.com>
> > <mailto:spark-dev%2Bunsu...@googlegroups.com<spark-dev%252Bunsubscribe@­googlegroups.com>


> > >.
> > > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en.
>
> > > --

> > > You received this message because you are subscribed to the Google Groups
> > "Spark View Engine Dev" group.
>
> > > To post to this group, send email to spar...@googlegroups.com<mailto:
> > spar...@googlegroups.com>.
> > > To unsubscribe from this group, send email to

> > spark-dev+...@googlegroups.com<spark-dev%2Bunsubscribe@googlegroups­.com>
> > <mailto:spark-dev%2Bunsu...@googlegroups.com<spark-dev%252Bunsubscribe@­googlegroups.com>


> > >.
> > > For more options, visit this group athttp://
> > groups.google.com/group/spark-dev?hl=en.
>

> > > --
> > > Chris Missalhttp://chrismissal.lostechies.com/
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Spark View Engine Dev" group.
> > To post to this group, send email to spar...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > spark-dev+...@googlegroups.com<spark-dev%2Bunsubscribe@googlegroups­.com>
> > .


> > For more options, visit this group at
> >http://groups.google.com/group/spark-dev?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Spark View Engine Dev" group.
> > To post to this group, send email to spar...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > spark-dev+...@googlegroups.com<spark-dev%2Bunsubscribe@googlegroups­.com>


> > .
> > For more options, visit this group at

> >http://groups.google.com/group/spark-dev?hl=en.- Hide quoted text -
>
> - Show quoted text -

Phil Haack

unread,
Jan 21, 2010, 6:36:10 PM1/21/10
to spar...@googlegroups.com
You mean this? http://sparkviewengine.com/usage/intellisense

To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.

Louis DeJardin

unread,
Jan 21, 2010, 6:53:42 PM1/21/10
to spar...@googlegroups.com
Yeah, the Spark VS langauge service as it stands only targets the VS2k8 sdk, registry, etc.

I fall into the same category... I need more help with extension methods signatures and properties on the model than html element/attribute assistance.

That said css/js/jquery support is something you miss... I find myself making scratch file to work on other bits to paste into a .spark file.

Phil Haack

unread,
Jan 21, 2010, 7:07:00 PM1/21/10
to spar...@googlegroups.com

It’s not the forgetting of HTML I worry about, it’s the auto-complete snippet like support you get in VS. It makes it *very* fast to build up views. I hate typing things fully now. ;)

Alexander Popov

unread,
Jan 26, 2010, 11:24:04 AM1/26/10
to spar...@googlegroups.com
For  me main project with Spark VSIntegration is that it writen  on Cpp.
For me it is stopping thing to contribute in it.

I belive that it can be on C# mostly.
for example nemerle VS Integration.

esc@per

unread,
Jan 26, 2010, 12:50:13 PM1/26/10
to Spark View Engine Dev
Hey, it must be easy to implement it on c# for vs2010.
Here's a series of posts which describes pretty well how to implement
full editor support for vs2010 for ndjango:
http://www.hill30.com/MikeFeingoldBlog/index.php/2009/07/31/django-editor-in-vs-2010-part-1-colors/.
I think it can be done for spark by analogy.

On Jan 26, 6:24 pm, Alexander Popov <mogada...@gmail.com> wrote:
> For  me main project with Spark VSIntegration is that it writen  on Cpp.
> For me it is stopping thing to contribute in it.
>
> I belive that it can be on C# mostly.

> for example nemerle VS Integration.http://nemerle.org/svn/nemerle/trunk/VsIntegration/Nemerle.VisualStudio/


>
>
>
> On Fri, Jan 22, 2010 at 3:07 AM, Phil Haack <phi...@microsoft.com> wrote:
> >  It’s not the forgetting of HTML I worry about, it’s the auto-complete

> > snippet like support you get in VS. It makes it **very** fast to build up


> > views. I hate typing things fully now. ;)
>

> > Behalf Of *Louis DeJardin
> > *Sent:* Thursday, January 21, 2010 3:54 PM


>
> > *To:* spar...@googlegroups.com
> > *Subject:* Re: Commented Issue: MVC2RC breaks latest version [4936]
>

> > Yeah, the Spark VS langauge service as it stands only targets the VS2k8
> > sdk, registry, etc.
>
> > I fall into the same category... I need more help with extension methods
> > signatures and properties on the model than html element/attribute
> > assistance.
>
> > That said css/js/jquery support is something you miss... I find myself
> > making scratch file to work on other bits to paste into a .spark file.
>
> >  On Thu, Jan 21, 2010 at 3:36 PM, Phil Haack <phi...@microsoft.com> wrote:
>

> > You mean this?http://sparkviewengine.com/usage/intellisense

> > <spark-dev%252Bunsubscribe@­googlegroups.com>
> > > > >.
> > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/spark-dev?hl=en.
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Spark View Engine Dev" group.
>
> > > > > To post to this group, send email to spar...@googlegroups.com
> > <mailto:
> > > > spar...@googlegroups.com>.
> > > > > To unsubscribe from this group, send email to
> > > > spark-dev+...@googlegroups.com<spark-dev%2Bunsubscribe@googlegroups .com>

> > <spark-dev%2Bunsubscribe@googlegroups­.com>
> > > > <mailto:spark-dev%2Bunsu...@googlegroups.com<spark-dev%252Bunsubscribe@ googlegroups.com>

> > > >http://groups.google.com/group/spark-dev?hl=en.-Hide quoted text -


>
> > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Spark View Engine Dev" group.
> > To post to this group, send email to spar...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > spark-dev+...@googlegroups.com<spark-dev%2Bunsubscribe@googlegroups .com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/spark-dev?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Spark View Engine Dev" group.
> > To post to this group, send email to spar...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > spark-dev+...@googlegroups.com<spark-dev%2Bunsubscribe@googlegroups .com>
> > .
>

> ...
>
> read more »

Alexander Popov

unread,
Jan 26, 2010, 3:22:27 PM1/26/10
to spar...@googlegroups.com
i mean that current implementation is c++, reimplementing it on c# probably mean drop old code at all, and write new one.

To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages