Configure the spark view engine! - asp.net-mvc-2

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.

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

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?

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

Related

PydevPlugin - set PythonInterpreterManager in new version

I am working on an Eclipse Java project which uses Pydev to interpret Python scripts. After the 6.3.0 version of Pydev, there has been significant changes on initializing plugin programatically and on Preference access objects. I couldn't find a relevant documentation for the new version.
For example, starting from v6.3.0 there is no PydevPlugin.setPythonInterpreterManager(IInterpreterManager im) method in the PydevPlugin class. However, I couldn't find an example or a document on initializing the interpreter manager with the new version. In earlier versions, the task is performed similar to the below 3 lines:
IInterpreterManager im = new PythonInterpreterManager(PydevPlugin.getDefault().getPreferenceStore());
PydevPlugin.getDefault().getPreferenceStore();
PydevPlugin.setPythonInterpreterManager(im);
Has anyone dealt with this issue?
The many changes related to the interpreter configuration have been done to better separate the core and ui related plugins.
You can see the tests (i.e.: org.python.pydev.ast.codecompletion.revisited.CodeCompletionTestsBase.setInterpreterManager(String)) as a reference in how to initialize it now (it now uses org.python.pydev.ast.interpreter_managers.InterpreterManagersAPI to set the interpreters).

.NET Standard 2.0 / EntityFrameworkCore / DB2 / IBM.EntityFrameworkCore issue

Does anyone here has experience with IBM.EntityFrameworkCore package? I've created a .NET Standard 2.0 library project in VS2017, added mentioned package, and tried to make it work by following this and this tutorial from IBM website, with no luck. I get the project compiled, but at the runtime I'm getting a System.TypeLoadException with the following message:
Method 'ApplyServices' in type 'IBM.EntityFrameworkCore.Infrastructure.Internal.Db2OptionsExtension' from assembly 'IBM.EntityFrameworkCore, Version=1.1.1.101, Culture=neutral, PublicKeyToken=7c307b91aa13d208' does not have an implementation.
Any help will be appreciated!
Thanks!
Update: The exception happens as soon as I try to use the context. It means after the context is successfully created, but before DbContext.OnConfiguring call happens.
I've solved it. It turned out that this exception happens if actual entity types (i.e. MyType) aren't defined in the same assembly (project) as the context. In my solution I had entity types defined in one project, and DbContextdefined in a different project, that references the first one, of course.
The reason for me to have such design was in the fact that there are two different packages (depending on the actual OS): IBM.EntityFrameworkCore and IBM.EntityFrameworkCore-lnx. So I've created two different projects, each referencing one of these packages. Still, I wanted to have all the entity types defined once... But obviously it cannot work like that.
Update: Sadly, it turned out that this isn't the only issue. I've ran into another one, described here. Thumbs down for DB2 .NET team! It's always frustrating to work with...

What does the Hammock.dll do?

I referenced the Couchbase assembly using NuGET in my project and it has a dependency on Hammock.dll. What does this assembly do? And is it really needed? In simple unit tests, my application works fine without the Hammock.dll being present. But I don't want any surprises when I move this app to production.
I would say [couchbase] still needs it, given there is a HammockHttpclient.
To answer the original question:
Hammock is an HTTP API library for .NET that greatly simplifies consuming and wrapping RESTful services.
This can easily be reasearched by going to the CouchbaseNetClient page and under Dependancies clicking Hammock. You can also go to the Couchbase Project and browse through the source to view if/where the library is still being used (as I have linked in the first sentence).

How can I configure the GWT Designer in the Google eclipse plugin

I created a GWT project and everything was great, but then I decided to change the entry point of the application.
It turns out that the class implementing EntryPoint has to be at top level inside the client package.
com.company.project.myui.client.WebUI was my original setup - I changed it to
com.company.project.myui.client.ui.NewEntryPoint
When I realized that this is not a supported configuration, I changed it back and everything is compiling, but now the GWT designer expects my views to be somewhere under
com.company.project.myui.client.ui.client which is wrong and it wont parse any of the ui classes.
I can't figure out where it is getting this configuration from.
Any help will be greatly appreciated!
You should provide a test case and a more complete error description (a complete stack trace at minimum).
Fixed it by deleting the second bundle and its bundle.xml configuration file.
Still, in my opinion this was unexpected behavior from the GWT designer.

Entity Framework 4.1, can't find Load() method?

Ok, I'm about to smash my keyboard with a hammer over this. I decided to play with EF this weekend and I started a project in 4.0. I find out 4.1 is out so I download and install the package.
Imagine my surprise when I go to use the Load() method in the dbExtensions and it can't find it. So I add a reference to the EntityFramework binary that the installer created, remove the System.Data.Entity reference from the project, rebuild, and it says
"The type
'System.Data.Objects.ObjectContext' is
defined in an assembly that is not
referenced. You must add a reference
to assembly 'System.Data.Entity,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'."
I tried to regenerate my model, I tried removing things, I tried directly referencing the 4.1 via usings. Nothing works.
I'm obviously missing something basic. How in the heck do I tell visual studio to use the 4.1 framework??!!
I managed to find the missing .Load() function by adding the following:
using System.Data.Entity;
Entity Framework 4.1 is not separate version. It still needs Entity Framework 4.0 and its assembly so yu can't remove System.Data.Entity.dll from your references. Also EFv4.1 is mainly about new DbContext API so unless you are going to swith from Entity objects to POCOs and DbContext you will not get any advantage by referencing EntityFramework.dll (except strongly typed Include on IQueryable).
Add a Reference to System.Data.Entity.dll from either:
GAC (.Net tab in add reference dialog)
or
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.Entity.dll
I got the same issue, and still don't know the root cause.
Finally I use some alternative solution:
var query = from d ...
query.Load();
or
(DbSet)context.myentity).Load();
Please try.
Ladislav's post is accurate. To add a little more detail, this ADO.Net team blog post explains how to correctly replace the code generation in an EF 4.0 project with EF 4.1.
However, I have a similar issue after upgrading to 4.1 and using DbContext (including some other features) I don't have a .Load() method either. I think you were in the same place I am before you started (unnecessarily) messing with references.
Check out the link above, let me know if it helps, and if you find a solution for the missing .Load() function be sure and let us know.