Dependency Injection using Unity

Just about two weeks ago the Microsoft patterns & practices team released a Community Technology Preview of the Unity project. Unity is a lightweight Dependency Injection Container. I've just been using it in some very basic scenario's, so far I like it. It has support for constructor and property injection. But also, a thing not many Dependency Injection container support I think, the ability to do method call injection.

David Hayden has some post on Unity on his blog. But most of all he has created a screencast on Unity, very nice to get an introduction to Unity.

Unity already gets some attention on the Internet. Oren Eini, a guy that's very experienced on Dependency Injection and did some coding on Castle Windsor another Dependency Injection container, has done a review on Unity.

Let's wait for the final release. Maybe I will add it to my toolbox. It still seams customers like open source projects from Microsoft more than open source projects from different hand. Maybe I will be able to apply Dependency Injection using Unity at a customers place.

IoC Container instance sharing

I haven't been able to use an IoC container on a real-world project yet. And even though I've been doing some research on it, I still have questions regarding IoC container usage.

I always thought about using the Application var for storing the container instance for an ASP.NET application. For other application I would use a static class or static var for the container instance. But thinking about this more and more, I'm not sure about this approach.

What approach do you think is the most sufficient way to share the container instance? Or should we not even share the container instance at all?