A: 

Sounds like a problem with your target type. You might try the following:

  1. Remove all service registrations and try them one at a time to determine the type that is causing the problem.
  2. Ensure that you can successfully instantiate the target type yourself.
  3. Verify that the target type doesn't have any other dependencies that are not accounted for in your service registrations.

It would be helpful to see the declaration and constructor(s) of the target type(s).

Try switching to another IoC Container:

Add a reference to MvcTurbine.Ninject.dll

Then:

public class MvcApplication : TurbineApplication
{
    static MvcApplication()
    {
        //ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator());           
        ServiceLocatorManager.SetLocatorProvider(() => new NinjectServiceLocator()); 
    }
}
Jeff French
I disabled all the Registrations and made all my controllers not accept a single parameter. Is there something else I can do?
borisCallens
Browse to the DLLs for MvcTurbine and Unity in Windows Explorer. Right click each one and click the Unblock button if it is present. I had a similar problem with a reference to a DLL I had downloaded being blocked by the "This file came from another computer and might be blocked to help protect this computer." and couldn't be loaded at runtime.
Jeff French
Nope, nothing :(
borisCallens
What version of MVC are you running?
Jeff French
See comments from OP. I am running latest beta V2. But that doesn't seem to impose the problem. It's only as soon as I add Db4objects.Db4o.Linq.dll this error message shows up. With turbine but without the Db4objects.Db4o.Linq.dll everything works, without turbine and with the library everything works too. Combine them and you get the message.
borisCallens
I wonder if this is actually a problem with Unity. Have you tried switching to Castle Windsor or Ninject? Nice thing about Turbine is you can switch IoC/DI containers with a reference and one line of code. See my answer for an updated code sample.
Jeff French
I tried with Windsor last night, but didn't check Ninject. Although I fear the problem might lie in the dbo4o lib rather then the Ioc containers. I'll update OP once I got the chance to check this out. As a side note: do you have any good resources on why to pick one over the other?
borisCallens
If both Windsor and Unity failed to load the type then I would definitely suspect a problem with the db40 lib. As for why to pick one IoC over another: I'm not sure. I'm pretty new to IoC/DI (been using it for about 2 weeks now :) ) My first shot at adapting my MVC 2 app to use Turbine went much like yours is so I switched to just using Ninject directly. Why did I pick Ninject over the others? It claims to be the "Ninja of dependency injection" which just sounds cool! :)
Jeff French
Hehe.. ninja's :)Well, I tried swapping them (ref OP), nothing. And I really want linq2db4O. Hope I can somehow get the DB4O ppl check this out.
borisCallens
+3  A: 

For the sake of writing down a proper answer. I think you're getting a TypeLoadException triggered by a failure to load an assembly that is referenced by Db4objects.Db4o.Linq.

Looking at it in ildasm shows that it requires the following assemblies that are shipped with db4o (use the same assemblies that came with Db4objects.Db4o.Linq to avoid any mismatch).

Those assemblies are:

  • Mono.Cecil
  • Cecil.FlowAnalysis

For the record, abd as of today, they're used by the LINQ to db4o query optimizer to analyze properties access in linq queries.

Jb Evain
Yes, that did the trick. Thanks :D
borisCallens
Note that in future releases, the usage of Mono.Cecil and Cecil.FlowAnalysis have been replaced by a Mono.Reflection assembly.
Jb Evain
+1  A: 

In order for Turbine to register your types, it needs to have the hosting assembly (Db4objects.Db4o.Linq) and ANY other assemblies that the hosting assembly might reference.

The stack trace in your original post says that when trying to resolve the types for your application something failed to resolve, which in this case it's not present.

Javier Lozano
Jeps, as @Jb Evain showed, it were a few libraries that db4o uses that weren't referenced correctly in my project. Now on to getting Nhaml my default view engine
borisCallens
Adding view engines was a matter of adding the correct reference entries and web.config entries. awesome :)
borisCallens
A: 

Jeff, MVC Turbine currently only supports MVC 1.0, I'm in the process of getting MVC 2.0 support for both .NET 3.5 and .NET 4.0. Please check http://turbineproject.com for information when they will be released.

Javier Lozano
My project is an MVC2 project and although it is currently only the "turbine'd" empty project template, it seems to run without any problems.. What are the current issues with Turbine + MVC2?
borisCallens
Mea culpa - I should have said that there is no "official" release yet for MVC 2.0, which means I've ran the unit tests, samples and compiled the against the MVC v2 binaries. If it works out the box, that's good to hear! :)If you run into any issues, don't hesitate to contact me.
Javier Lozano