Click here to Skip to main content
15,867,453 members
Everything / IOC

IOC

IOC

Great Reads

by Akhil Mittal
A tutorial to learn dependency injection with the help of a simple example
by Sacha Barber
Azure Service Fabric Demo + IOC, logging, encryption
by DotNetSteve
A gentle introduction for DI and IOC in the first program most of us have written - Hello World
by Fiyaz Hasan
Learn how dependency injection mechanism has evolved from ASP.NET to ASP.NET Core

Latest Articles

by Daan Acohen
Simplify and resolve circular dependencies in .NET using the SmartInject NuGet package
by Nick Polyak
Describes how to install dynamically loaded plugins as nuget packages
by Nick Polyak
I explain the Inversion of Control and propose simple but powerful interfaces for implementing IoC frameworks.
by Aly Elhaddad
Introduction and documentation for new ThunderboltIoc framework that achieves DI in .NET without reflection

All Articles

Sort by Score

IOC 

13 Mar 2018 by Akhil Mittal
A tutorial to learn dependency injection with the help of a simple example
29 Nov 2017 by Sacha Barber
Azure Service Fabric Demo + IOC, logging, encryption
26 Feb 2016 by DotNetSteve
A gentle introduction for DI and IOC in the first program most of us have written - Hello World
28 Dec 2016 by Fiyaz Hasan
Learn how dependency injection mechanism has evolved from ASP.NET to ASP.NET Core
29 Jul 2016 by Hein Pauwelyn
This is an application made for Windows (Universal) 10 devices made with MVVM, IoC-containers and dependency injection. There is also an API from Yahoo and SQLite service.
26 Dec 2016 by n.podbielski
Use of IoC container in Xamarin on example of TinyIoC
13 May 2018 by Nick Polyak
New simple but powerful IoC container
2 Feb 2012 by Dean Oliver
How we can harness the power of MEF and extend it by way of generics.
23 Mar 2016 by Rubén Hinojosa Chapel
Prototype for a plugin architecture based on the Prism Library and the Modern UI for WPF (MUI) toolkit
17 Jan 2023 by Nick Polyak
Describes how to install dynamically loaded plugins as nuget packages
29 Nov 2015 by MatthewThomas
Adding design time support for regions in Prism 6
26 May 2016 by Dilip Nandakumar
Using Dependency Injection to manage navigation and assigning data context in MVVM design.
5 Jan 2016 by levelnis
Article examining one approach to reducing controller dependencies in an ASP.NET MVC application by using generic factories.
13 Feb 2016 by Roger C Moore
Exploring Dependency Injection / Inversion of Control (IoC) with Managed Extensibility Framework (MEF)
23 Feb 2015 by Veronica S. Zotali
How to use TypedFactoryFacility using Castle.Windsor
5 Jan 2016 by levelnis
In an earlier article, I wrote about reducing controller dependencies with generic factories. One criticism of this approach, which I agree with, is that it hides those dependencies. This article looks at an alternate approach - using facades.
8 Jun 2018 by Ansel Castro
The article describes some exciting features of Enterlib for Android like its Object Relational Mapper and the Dependency Injection Engine.
27 Dec 2018 by tranthanhtu.vn
[TinyERP: SPA for Enterprise Application]Manage Staffs - Part 2
12 May 2012 by Wendelius
The constructor is used to set the private variable which isn't visible outside the class. Valid scope for the parameter obj is only the constructor. Yes, after succesfully calling the constructor the private field should contain the same object.
27 Feb 2014 by Maciej Los
Have a look here: Castle Windsor Tutorial in Asp.Net MVC[^]
28 Feb 2014 by Aditya Magotra
Hi Maciej,I implemented it in below fashion. Can you please let me know whether i implemented properly :Register Windsor Container in Global.asax :- -----------------------------------------------------private static WindsorContainer _container = null; /// ...
5 Mar 2021 by phillipvoyle
Miniature IOC container
17 Jan 2016 by OriginalGriff
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself.Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null -...
30 Jul 2019 by Sunny Makode
There are several contents available on the internet that talk about injecting dependencies through .svc file's markup [in WCF service application] and it's easy when you have a WCF service application. But, it is equally easy to do that even in your WCF Library project (without .svc).
4 Aug 2010 by Thomas Weller
From the many available IoC containers out there, LinFu is the one that I like most. This is because it is extremely simple to use, needs almost no configuration at all, and yet it is highly flexible and extensible, if you need to do some more complicated things
30 Jun 2011 by yy3b2007com
the code:ServiceLocator.SetLocatorProvider(()=>_container.Resolve());what I can't understand is that use the IServiceLocator with Castle in the code .Is it that use the IServiceLocator as a component or other ?help ,thanks.
29 Jul 2013 by koleraba
HiI am hosting an web api which exposes a few REST services in a windows service. Since this is a windows service I use the HttpSelfHostServer class to host the api. Does anybody has any exprience on how to integrate an autofac IoC with self hosted web api. I know there is an integraion...
30 Jul 2013 by koleraba
I found the solution to my problem. Actualy the steps needed are almost the same as when setting the autofac with web api hosted in the IIS. So to set-up the autofac with the self-hosted web api follow the next steps:- download the Autofac.WebApi nuget package- set the the autofac builder...
16 Oct 2013 by Member 10188921
first ,please look my exception infos in below:exception time:2013-10-15 09:08:30,765 [1] exception level:ERROR exception class:logerror [(null)] SpringFactory.GetObject(adminFacade) System.InvalidOperationException: root context is currently in creation. You must not call...
9 Nov 2013 by Member 10188921
thank u for you answer,I found the root cause which result in that exception.It's my IIS.my project is deploied on iis7.0 with integrerad pipeline mode.But during initialization of the spring IOC container,there is a action that rewriting Httpcontext.Unfortunately, In the pipe events of...
16 Jan 2014 by koleraba
HiI have a problem which I am not quite sure how to handle. When my application starts, I need to read the configuration file and - based on the data read from the file construct some objects. The objects are constructed using reflection - I look for a most suitable constructor and invoke...
18 Jan 2014 by koleraba
Sorry for the lame question. The solution is obvious but I somehow missed it. To register all interfaces implemented by some instance all one has to do is:builder.RegisterInstance(instance).AsImplementedInterfaces();
13 Jun 2014 by ShacharK
Hey,I have a general framework which contains a lot of assemblies, some are common, some are designed for Server applications, and some for Client applications (Each feature has a base-line library while any application-type-specific extensions are defined in a different assembly). I'm...
17 Jan 2016 by Member 11470311
How Property Injection works in Caliburn Micro. Here is my Bootstrapperpublic class AppBootstrapper : BootstrapperBase { SimpleContainer container; public AppBootstrapper() { Initialize(); } protected override void...
17 Jan 2016 by Sergey Alexandrovich Kryukov
You did not show where the exception with the message "Object reference not set to an instance of an object" is thrown. Not to worry. This is one of the very easiest cases to detect and fix. It simply means that some member/variable of some reference type is dereferences by using and of its...
1 Jul 2017 by Morny
Hi I’ve come to the conclusion that a C# MVC 5 project (using Entity framework, code first and migrations) I’m working on has grown too big to fit the “out of the template” structure. I’m trying to build a site where the public part at the site is placed in the “root” or where a site build on...
1 Jul 2017 by RickZeeland
These seem like hands-on articles on the subject: An Absolute Beginner's Tutorial on Dependency Inversion Principle, Inversion of Control and Dependency Injection[^] Inversion of Control, Dependency Injection and Service Locator in C# – CsharpStar[^] Inversion of Control and Dependency...
18 Jul 2017 by eddieangel
I need a bit of help here trying to solve a problem using Castle Windsor and NHibernate. I have been reading different articles on this subject for a couple of days and I can't find a solution for my particular issue. What I want to do is have two database connections, a local and a remote....
27 Aug 2018 by Member 13953081
Autofac IOC always create problem at production server / hosting in Asp.Net Web Site (c#) How to resolve this issue, without changing Trust level? Inheritance security rules violated while overriding member: 'Autofac.Integration.Mvc.AutofacDependencyResolver.GetService(System.Type)'. Security...
1 Feb 2020 by Ahmed Dabas
Hi ... i'm working on wpf app (without Mvvm Pattern) using Generic Repository and Unit Of Work and Autofac the problem that i face, when i save data to database , nothing happen (not saving) i try alot of things and nothing working the file uploded at this link TimCoAutoFac[^] What I have...
15 Jan 2023 by Nick Polyak
I explain the Inversion of Control and propose simple but powerful interfaces for implementing IoC frameworks.
18 Aug 2014 by Sul Aga
Using Autofac IoC container in MVC application to resolve dependencies. Scenarios included: controller, custom filter and view dependency injection
1 Mar 2016 by Akhil Mittal
Resolve dependency of dependencies using Inversion of Control and dependency injection in Asp.net Web APIs with Unity Container and Managed Extensibility Framework (MEF).
9 Apr 2015 by João Matos Silva
A near real world example of usage of the Interceptor Pattern to leverage new behavior without changing implementations
1 Mar 2016 by Akhil Mittal
My article will explain how we can make our Web API service architecture loosely coupled and more flexible.
24 Sep 2019 by Matthew Dennis
Munq IOC Container Version 3 has been released on CodePlex and as a NuGet package. This article demonstrates how to integrate the IOC Container into an ASP.NET MVC3 project.
14 Jul 2015 by Shivprasad koirala
In this article we will learn C# Design pattern and Architecture pattern Step by Step with a project.
12 Feb 2022 by Aly Elhaddad
Introduction and documentation for new ThunderboltIoc framework that achieves DI in .NET without reflection
8 Oct 2015 by mvastarelli
How to override Castle Windsor's default behavior and make properties into required dependencies.
15 Jun 2016 by wmjordan
This is an alternative for "Interceptor in the Wild". The Function Decorator Pattern offers a way to inject new behaviors into existing methods without using IoC frameworks nor modifying method implementations.
9 Jun 2015 by Leszek Koc
Three different approaches to handle Session access in MVC applications.
17 Dec 2013 by Monjurul Habib
ASP.NET Web API is a framework for building and consuming HTTP services that can reach a broad range of clients including browsers, phones, and tablets.
31 Dec 2013 by Shivprasad koirala
Dependency Injection (DI) vs. Inversion of Control (IOC).
18 Apr 2012 by Dean Oliver
A short guide to what to look forward to in the next release of MEF.
28 Apr 2020 by Chinmaya C
Explanation about DIP and its need in the real time scenario
26 Jan 2016 by Rasik Bihari Tiwari
Dependency injection, DI containers, IoC containers and Inversion of control are a world of confusion. Let's take them head-on.
23 Aug 2016 by xxlben
Use dependency injection to communicate seamlessly with remote services.
18 Nov 2013 by Peer Adi
A WPF application base solution using Castle Windsor and commonly used utilities.
8 Feb 2017 by Rasik Bihari Tiwari
Let's understand exactly what is Dependency Inversion principle and what it is not. How people confuse it to be dependency injection which is it NOT.
17 Jun 2013 by Phil Lee NZ
This article will show you a pattern for sending and receiving messages using Azure Service Bus + worker roles in a strongly typed manner, taking advantage of the built-in functionality that comes with Brokered Messages.
28 Dec 2017 by Jeff Ronay
This post discusses why you should use an interface.
18 Sep 2013 by Houssem_Dellai
Using Unity container instead of SimpleIoc in MVVM Light
29 Nov 2013 by Jeff Vanzella
Injecting servers, buckets and passwords into CouchbaseClient
29 Jan 2018 by Nick Polyak
Roxy is a powerful new Roslyn based proxy generation packages that facilitates separation of concerns, creating adaptors and smart mixins.
16 Oct 2014 by ankurbora
How to implement Inversion of Control ( IoC) using Ninject .NET container
17 Apr 2017 by Gary Harpaz
Dependency injection frameworks are bad practice. So how can we still use dependency injection? Just do it yourself!
19 Jan 2015 by Sean Hart
Using Dependency Injection to rapidly create applications
10 Nov 2017 by Vijay Gill
Uses Unity for DI and NLog for logging
24 Jun 2014 by jgauffin
Running services in long lived applications in .NET
7 Apr 2012 by Henry He
In this article, I will show how to build a pluggable application with IoC container.
12 May 2012 by Ali_100
Design pattern – Inversion of control and Dependency injection[^]I am sorry if it is silly questionin the constructor methodology paragraph ...there is public class clscustomer{ private Iaddress _address; public clscustomer(Iaddress obj); { _address=obj; ...
19 Jan 2015 by Sean Hart
Appending Items to a Unity Container at Runtime via Configuration edit
23 Jul 2012 by PratapReddyP
CodeProjectIn this post we will see 2 important things.1. Using Unity Dependency Resolver2. What is Lifetime manager and its significance.Step 1: Create a regular MVC web application. create a new separate class library project.
3 Oct 2023 by Daan Acohen
Simplify and resolve circular dependencies in .NET using the SmartInject NuGet package
27 Feb 2014 by Aditya Magotra
Hi,Can anybody please let me know how to register interface using Castle.Winsdor in Application_Start Event of Global.asax & then how to access the registered interface on the web.page.If there is another appropriate approach please let me know.Any help will be highly...
23 Jan 2015 by vudangngoc
Is it easy to create an IoC container?
28 Mar 2017 by Sabyasachi Mukherjee
I am using WPF with Entity Framework 6 (DB first), Caliburn.Micro, and MEF.I am trying to implement IoC in my project. I am an absolute beginner in IoC, and unfortunately, I cant find too many examples where MEF is used with Repository Pattern.So I have a few repositories, and I have...