views:

133

answers:

4

I'm looking at launching a new site using the Spark View Engine, I am however having difficulty finding some referance to the set-up of Spark Using VS2010 and MVC2. Can anyone provide a referance to a guide that describes this process?

I've looked at some of the code in the sample but the projects dont convert to VS2010. Before I tear these apart I wonder if there is somthing already out there? I also need to configure Re-Sharper and VS to work with Spark

I have seen - http://sparkviewengine.com/documentation/configuring#AddingtoAspNetMVC But this it's a pretty basic overview I'm looking for a real world example.

===== Edit

The source provided on DotNetSlackers doesnt run! Errors with the mismatch of .Net version

"Dynamic view compilation failed. (0,0): error CS1703: An assembly with the same identity 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Try removing one of the duplicate references."

If I add the latest DLL's to the DotNetSlackers example I get the following

"Attempted to access an element as a type incompatible with the array."

protected void Application_Start()
{
    SparkViewFactory svf = new SparkViewFactory();
    PrecompileViews(svf);
    **ViewEngines.Engines.Add(svf);**
    RegisterRoutes(RouteTable.Routes);
}

On the stared line above.

A: 

Here's a good starting point for all things Spark:

dev.dejardin.org

Also...

dotnetslackers article

Stewart Ritchie
The source provided on DotNetSlackers doesnt run! Errors with the mismatch of .Net version "Dynamic view compilation failed.(0,0): error CS1703: An assembly with the same identity 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Try removing one of the duplicate references."
Pino
A: 

hmm, there are a whole bunch of introductory screencasts on the website: http://www.sparkviewengine.com

as well as the reference documentation, which is very helpful: http://www.sparkviewengine.com/documentation/configuring

are you having a specific problem?

dave thieben
All the examples are 2008 and dont convert nicley to 2010. Where are the screencasts?
Pino
@dave thieben see above I've edited post with more errors.
Pino
screencasts are on the home page under "Introduction and Learning"
dave thieben
+1  A: 

Your "dynamic view compilation failed" error is because Spark hasn't yet been rebuilt to work with .NET 4.0. Your options at this point are:

1) Target .NET 3.5 instead

2) Wait for a new version of Spark

3) Get the Spark source code and rebuild it yourself against .NET 4.0 - see http://groups.google.com/group/spark-dev/msg/028d0cf129c4b1ff for further info

Jonathan Moffatt
A: 

I recently did a screen-cast here. Setting up on MVC2 is in the video at 6min40sec if you want to see how it's done.

http://blog.robertgreyling.com/2010/08/elegant-mvc-with-spark-way-views-were.html

As a side note - The source code has now been moved to VS2010 in the master branch and it will also compile views dynamically to .NET 4.0. avoiding the error you got. You can either download the source and recompile the latest binaries, or for your convenience, we added them to NuPack/NuGet if you'd prefer to reference them that way.

Hope that helps

RobertTheGrey