Still getting familiar with the limits of MonoTouch. Is there an IoC/DI library that can be used with MonoTouch. Something like Ninject ideally?
6 Answers
Give TinyIoC a try - http://www.grumpydev.com/2010/03/02/announcing-tinyioc-an-easy-to-use-hassle-free-inversion-of-control-container/
Cheers,
ChrisNTR

- 2,208
- 20
- 28
-
Looks promising based on the description. I just need something lightweight anyways. Will give it a try tonight. – Ross Hambrick Apr 12 '10 at 16:13
-
I've just started using this and it's great :) – Aug 24 '10 at 12:15
-
I also use this in a MonoTouch app, and LOVE it. – NovaJoe Oct 09 '12 at 20:06
I went through this evaluation process, and I found that Funq was a nice clean implementation that gave me enough power to do what I wanted without over complicating things (or dragging is massive dependencies). It's nice and clean, and supports lazy object initialization through lambda expressions.
I evaluated 5 or 6 different containers specifically for use with MonoTouch.

- 4,159
- 4
- 32
- 53
-
-
Sorry, I cant recall which ones I tested. I just plugged them into my application an tried to achieve the level of functionality I needed, and evaluated how much 'fudging' was required for each library. As mentioned - Funq was really easy to use, and provided everything I needed. – Adam Jun 24 '11 at 03:42
I've released Stiletto, an IoC that works on all .NET platforms, including Xamarin and MonoTouch. It lets you specify your dependencies mainly using attributes, and gets around limitations on runtime reflection and generic instantiations by doing its thing at compile-time.
EDIT
I'll have to update the docs, but the pre-compile tool does not work with the current build tools in Xamarin Studio. Stiletto pre-compilation requires xbuild, which is supported for Xamarin.Android but not for Xamarin.iOS! Unfortunately, this means that my answer is mostly incorrect - that is, unless you want to write iOS apps in Visual Studio, which is what I'd been doing! Apologies. Will delete this answer in a few days.

- 6,023
- 1
- 25
- 40
-
From the docs it looks like it has only Attribute-based configuration. Is it true? – Shaddix Oct 28 '13 at 02:30
-
Yes, explicitly so. It's designed to use compile-time codegen to get around restrictions on iOS that hinder current IoC containers, and so isn't very configurable at runtime - beyond Container.Add(Container), that is. – Ben Oct 28 '13 at 18:01
Thought I'd mention Spring.Net, we use the original [Java] version extensively in all our applications.
Spring [on Java, at least] has many. many [optional] modules. I haven't tried the .Net version myself, but I'm interested to find out how it compares.
Cheers
Rich
P.S. Spring.Net is Apache licensed, so its usable in closed source, commercial projects (think iOS/iPhone etc.)

- 5,864
- 1
- 40
- 64
-
Why the down vote? If you have information to the contrary that Spring.Net can't be used with Monotouch, please update this page to let everybody know that. Otherwise, my "suggestion" is still a valid one, no? – Big Rich Jul 19 '12 at 14:25