Top "Unity-container" questions

The Unity Application Block (i.e. Unity) is a lightweight, extensible dependency injection container for .NET with support for interception.

Make sure that the controller has a parameterless public constructor error

I have followed this tutorial which has worked great, until I modified my DbContext to have an additional constructor. I …

c# asp.net-mvc asp.net-web-api unity-container
Can someone explain Microsoft Unity?

I've been reading the articles on MSDN about Unity (Dependency Injection, Inversion of Control), but I think I need it …

c# dependency-injection inversion-of-control unity-container
How do the major C# DI/IoC frameworks compare?

At the risk of stepping into holy war territory, What are the strengths and weaknesses of these popular DI/IoC …

c# dependency-injection unity-container ioc-container ninject
Exception is: InvalidOperationException - The current type, is an interface and cannot be constructed. Are you missing a type mapping?

In my bootstrapper: namespace Conduit.Mam.ClientServices.Common.Initizliaer { public static class Initializer { private static bool isInitialize; private static readonly …

c# asp.net-mvc inversion-of-control unity-container
Cannot Inject Dependencies into ASP.NET Web API Controller using Unity

Has anyone had any success running using an IoC container to inject dependencies into ASP.NET WebAPI controllers? I cannot …

c# .net asp.net-web-api unity-container
Can I pass constructor parameters to Unity's Resolve() method?

I am using Microsoft's Unity for dependency injection and I want to do something like this: IDataContext context = _unityContainer.Resolve&…

c# .net dependency-injection unity-container constructor-injection
Is there a pattern for initializing objects created via a DI container

I am trying to get Unity to manage the creation of my objects and I want to have some initialization …

dependency-injection inversion-of-control unity-container ioc-container interface-design
Cannot get rid of "physical connection is not usable" exception

I am about to shoot myself. Spent few weeks now trying to solve this issue. We have an ASP.NET …

sql-server asp.net-mvc entity-framework unity-container ioc-container
Could not load file or assembly System.Web.WebPages.Razor, , Version=3.0.0.0 or one of its dependencies

I am using MVC 5, WCF and Unity framework in my application. I am getting below error when I run WCF …

asp.net-mvc wcf inversion-of-control unity-container
Unity Singleton Code

I'm new to Unity and am trying to write some Unity logic which initialises and register/resolves a singleton instance …

c# unity-container