Click here to Skip to main content
15,883,990 members
Everything / Dependency

Dependency

dependency

Great Reads

by Fiyaz Hasan
Learn how dependency injection mechanism has evolved from ASP.NET to ASP.NET Core
by Habibur Rony
This will cover how to use Domain Driven Design in your application according to the Onion Architecture. There are short descriptions about architecture Category / Style, N-Layer / N-Tier Architecture, Template Method Pattern and Facade Design Pattern.
by GProssliner
cobj is a preprocessor based generator for interface based polymorphism
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.

Latest Articles

by Matteo Prosperi
Being an engineer on the AWS SDK for .NET team, I tasked myself with figuring out how to use our libraries under Blazor in the browser.
by Chinmaya C
Explanation about DIP and its need in the real time scenario
by L. Michael
This article provides a recipe on how to avoid producing legacy code at the speed of typing by using a proper architecture and unit testing.
by Sharp Ninja
Simple Dependency Injection, the customizable way. Learn about the SimpleDI framework for creating simple and effective dependency injection.

All Articles

Sort by Score

Dependency 

28 Dec 2016 by Fiyaz Hasan
Learn how dependency injection mechanism has evolved from ASP.NET to ASP.NET Core
5 May 2017 by Habibur Rony
This will cover how to use Domain Driven Design in your application according to the Onion Architecture. There are short descriptions about architecture Category / Style, N-Layer / N-Tier Architecture, Template Method Pattern and Facade Design Pattern.
7 Jun 2016 by GProssliner
cobj is a preprocessor based generator for interface based polymorphism
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.
22 Nov 2017 by Graeme_Grant
This is an alternative for "Simplest WPF Dependency Property For Beginners On Background Color"
6 Aug 2014 by DannyVarod
Fast, stable and powerful creation of NuGet packages
14 Mar 2013 by Sergey Alexandrovich Kryukov
In addition to the answer by Andreas Gieriet:http://en.wikipedia.org/wiki/Dependency_injection[^].—SA
13 Jan 2014 by Jeremy Likness
Learn how to perform interception of services using Angular's decorator feature.
1 Mar 2015 by Bankey Sharma
Some general guidelines to make application source agnostic and business adaptive
23 Feb 2015 by Veronica S. Zotali
How to use TypedFactoryFacility using Castle.Windsor
28 Dec 2015 by Purbasha Ghosh
Initialize MVC controllers with multiple instance resolutions of same interface
10 Jan 2013 by Allgaeuer
Ok, i found the solution.See the following links:Visual Studio 2010 not autolinking static libraries from projects that are dependencies as it should be supposed to[^]What does the “Link Library Dependency” linker option actually do in Visual Studio 2010?[^]
14 Aug 2013 by Bernhard Hiller
To reduce coupling, extract interfaces from the classes (some version of Visual Studio can do that), and use the interfaces in the parent class.Nowadays, Dependency Injection is a common way to get the child objects into the parent class, typically via the constructor (in its signature, you'll...
2 Dec 2009 by ASP.NET Community
Observer pattern
15 Jan 2014 by Sander Rossel
Hi all,I have a question about how to handle database dependencies in 'generic' dll's.For example, I have written a dll that logs exception information to a database. We want to use this functionality for multiple customers.Now let's assume I have used this functionality for customer A...
15 Jan 2014 by Pete O'Hanlon
What you are talking about is software versioning, and it's part of a very big topic - release management. Whole books can be written about this area.So, the big question is, are there any simplistic ways of achieving this? The answer is yes, but it requires you to put quite a bit of...
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; /// ...
21 Aug 2014 by Manoj Kumar Choubey
Dear all I would like to make application with the combination of web api controllers and mvc controllers both I installed following nuget packages1. unity.mvc43. unity.webapi4. webapiand I want to impliment dependency injection but I am having problem with dependency...
2 Apr 2015 by Sascha Lefèvre
You can't. And you shouldn't, even if it was possible. It makes no sense - why would you want to do that? If M1 and M2 are specific to B and M3 specific to C, then implement M1 and M2 in B and M3 in C.It would violate the principle of polymorphism[^]: A subclass should behave like the...
1 Dec 2015 by E.F. Nijboer
You need to drain the output streams to prevent hanging. Check the links for some detailed info. http://www.rgagnon.com/javadetails/java-0014.html[^]http://steveliles.github.io/invoking_processes_from_java.html[^]Good luck!
23 Oct 2016 by Matthew So (Hong Kong)
A task processing server with RDLC Implementation and extensible to customized handlers
15 Jun 2023 by Member 13992703
I'm currently struggling with the following issue: I need to use an interface in my plugin (PLUGIN A) that comes from another plugin (PLUGIN B). I'm also the developer on PLUGIN B so I can make code changes (if needed). What I've done so far: ...
22 Jun 2012 by jgauffin
Griffin.Container: Introducing the Command Support
3 Sep 2012 by jim lahey
Hello everyone,I'm using PostSharp to implement logging and security aspects in my application. PostSharp uses attributes to decorate methods with aspects which are then modified at compile time. Does anyone know of a way that I can use dependency injection with these aspects? I'm...
4 Sep 2012 by Martijn Kok
In a book I recently read about dependency injection (Dependency Injection in .NET by Mark Seemann [^]) there is a chapter (chapter 9) that might interest you. The chapter is about interception. Dynamic interception is discussed and compared with using the decorator pattern and using attributes...
25 Sep 2012 by Bernhard Hiller
You can add dependencies via the registry or via the command line. See e.g. http://www.kiwisyslog.com/help/cattools/index.html?appserv_howtoaddservdepends.htm[^]
4 Oct 2012 by Shahriar Iqbal Chowdhury/Galib
Hi All,I need to know Which dependency injection framework is better to work with asp.net MVC 4? I go through different comparison and seems like unity and structure-map is slower in terms of performance also configuration is complex. My consideration is configuration flexibility and...
4 Oct 2012 by Karthik. A
I use Ninject for my personal projects and I find it to be good, as it has a lot of documentation. Lot of people are using it and so it's easier to find information and also best practices with respect to the usage of ninject. For instance, my website uses ninject for dependency injection and...
9 Oct 2012 by akchandra9
what are the advantages of Dependency Property. where it is used in wpf? sample code?
9 Oct 2012 by akchandra9
Each WPF control registers a set of DependencyProperties to the static DependencyProperty class. Each of them consists of a key - that must be unique per type - and a metadata that contain callbacks and a default value. All types that want to use DependencyProperties must derive from...
10 Oct 2012 by Clifford Nelson
This is from http://stackoverflow.com/questions/2505234/need-a-short-and-clear-definition-for-dependency-properties[^]:A DependencyProperty is a property whose value depends (or can depend) on some other source (such as animation, data binding, styles, or visual tree inheritance). A regular...
21 Nov 2012 by chuckdawit
Reading through: http://lostechies.com/wp-content/uploads/2011/03/pablos_solid_ebook.pdfand reading the chapter on DIP (dependency inversion principal, the first example by Jimmy Bogard, is slightly confusing.in his example he takes a class that has two dependencies in the method he...
19 Dec 2012 by Mawy
Binding binding = new Binding(); binding.Source = this; binding.Path = new PropertyPath("ActualInterior"); element.SetBinding(Shape.FillProperty, binding); binding = new Binding(); binding.Source = this; binding.Path =...
10 Jan 2013 by H.Brydon
I'm not following the story quite 100% but it sounds to me that you have something mixed up in the __declspec(dllimport) and __declspec(dllexport) symbols. Make sure that you have these and the macro symbols using them set up correctly.
17 Jan 2013 by devdev13
Please see the code below. I am trying to create a drop down by using EF database first approach, and implementing Ninject for DI. I'm new to these concepts, and I don't know what I'm doing wrong. Any help would be greatly appreciated - thanks.**Below is my Error:**Cannot implicitly...
20 Jan 2013 by Jameel VM
Please update your viewModel like belowpublic class MyViewModel { public string SelectedCityId { get; set; } public IEnumerable Cities { get; set; } }Hope this helps
5 Mar 2013 by Mycroft Holmes
You are creating an infinite loop, in your get data you use the event dependancy change and then change the data, when you change the data dependancy change event fires and you start again.
14 Mar 2013 by Patrick Skelton
Hi,I have an interesting C# conundrum, which I can't think of a neat solution for ... or any solution.I have two libraries - call them LibA and LibB. There must be no dependency between these libraries (i.e. a client application must be able to use either of these libraries without the...
9 May 2013 by Sergey Alexandrovich Kryukov
Calculate it. Imaging you know that there is no fixed column and row, but you calculate both from some cell values, in integer indices, let's say, relative to the location "A1". Imagine your calculation is done in the methods:Function GetRow(...) As Integer' ...End FunctionFunction...
9 Aug 2013 by webdevchris
I am building an API using Web API and integrating dependency injection using Autofac. I have a requirement whereby the controller should use different repositories based on a url parameter. So for example, one repository has business rules for one client system and a second could have a...
9 Aug 2013 by webdevchris
I am looking at moving from Ninject to Autofac but am struggling to translate one of the useful features - constrained binding through attributes.I currently have this interface:public interface IRepository{ IEnumerable Get();}And then a db...
3 Oct 2013 by kpkaran88
I created windows service using C# I want to do some process depending the table valuesSo i used sql notification to do the process.With reference of this linkhttp://msdn.microsoft.com/en-us/library/a52dhwx7%28v=vs.80%29.aspxIf we didn't use the service long time it will go to...
23 Oct 2013 by Ali_100
I need some opinion, if I am using user control & aspx page, & i have the requirement to use aspx page's label depend on some condition of usercontrol.but page_load event of aspx page is fired first , then user control's page_load event fired, so how do you able to update the label of aspx...
23 Oct 2013 by Vinodh.B
hiI suggest you to use a delegate in cs page which will be listening to the usercontrol events .
14 Dec 2013 by HarisJayadev
Hi Friends, Hope all doing well. I'm new to dependency injection. i got a doubt while reading about Ninject. In Ninject wiki i saw an basic example for Dependency Injection. From that my doubt arises.This is the link....
14 Dec 2013 by Andreas Gieriet
What is your expectation on DI?DI does not magically extend functionality.DI allows to pass dependencies explicitly from outside instead of implicitly instanciating the dependencies.If you add in your Samurai class some new dependency, you have to provide means to pass them (DI) to the...
14 Dec 2013 by BillWoodruff
If you are going to extend a Class to use another instance of another interface, then ... yes ... you will need to change the Class: if you didn't how would the Class ever "know" about, or be able to use, the added interface ?However an option would be extend some larger-scope entity that...
23 Jan 2014 by javad_r_85
i want create modular application in asp mvc 4 like joomla cms and i want use area for moduls and create new solution for Each moduls where each moduls is 3layer (service layer- domin classe - Model) . I user Code first.how implement it?
15 Apr 2014 by VishalKadiwala
Hi,I am creating a WCF service from scratch.I am using this WCF service to hold my all business logic and data access logic.If any one can help me to understand that what is the best practice or a best template to use for the same. I have heard about EF, UnitOfWork, Repository Pattern...
17 Oct 2014 by srilekhamenon
How to inject a my dataclass in winform using dependency injection my code isin my program.cs [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ...
20 Oct 2014 by Nathan Minier
The primary issue with your code sample is the calling of the MainForm from your Main thread. After dusting off my constructor injection knowledge (I don't use it terribly much) it looks like you do have a good constructor injection model in place. if (Settings.GlobalSettings.LoginSuccess...
14 Jan 2015 by Pheonyx
Hi Guys,This may be a silly question, but I've been trying to improve my knowledge on Dependency Injection and am re-working an existing (fairly simple) project to utilise my new knowledge.However, I have the following question and I'm not certain what the correct approach is.I have...
22 Feb 2015 by Supradeep Choudhury
Hi friends...Thanks for visit...I am facing a problem [due to lack of knowledge] in Visual Studio 2013. My project is under development. I have to create a dependency graph which I generated in VS2013 and saved. Now day by day new classes are created by developers and attached with project....
2 Apr 2015 by 9000605667
I have a class A with 3 methods M1,M2,M3.Class B is inherited from Class A & Class C is inherited from Class B.Now all the methods in Class A are accessible for Class B & Class C.Now i want to restrict 1)M1 & M2 of Class A for Class B2)M3 for Class C .How can i do this.
11 Jun 2015 by Lance Contreras
Create an easily resusable IconBlock (TextBlock that display's an icon)
15 Sep 2015 by Alex(Lei) Chi
Guys, I am looking for a service deploy tool with scheduler configuration and dependency for a while.I remember it should be WIX(Windows Installer Xml) - four years ago memory.it should support:Remoting deployment managementSchedule TaskService dependency configurationactually,...
15 Sep 2015 by Richard MacCutchan
Please read Code Project Quick Answers FAQ[^].
1 Dec 2015 by Chris Copeland
Hi all,I'm trying to enable command-line processing within a Java application to automate certain events whenever command-line arguments as passed into the application.There are two applications which are executing, management and reports. The idea is to allow the management software to...
29 Feb 2016 by mayooran99
I have a library project which is built in maven. It has its dependencies. I need to export this project as a jar (Not a runnable jar). Should I include the dependencies along with my jar or should I not? Because when I exported the dependencies with my jar, there were conflicts when the same...
4 Mar 2016 by Sergey Alexandrovich Kryukov
First of all, you have not two injecting dependencies, but three. The answer is: not only two dependencies are not tightly coupled, but there is no coupling issue at all. You probably think that two instances are coupled via common IAccountInfo, but… there is nothing like that. You have,...
11 Mar 2016 by Anil Ghildiyal
Hello all, I am using sql dependency to get notifications from sql server, also using signalR for sending notifications to all active clients. I have already achieved the results as expected but now I need to use a complex select query instead of a simple statement.What I have...
15 Nov 2016 by shikhar gilhotra
Hi friends, Can we use abstract class in Dependency injection instead of an Interface. please give answer if u have implemented it. no fake replies please. ?What I have tried:i tried adding an abstract class but ut does not work.
6 Mar 2018 by Tisham Ahuja
Below is the code in app.module.ts file import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { HomeComponent } from './HomePage/home.component';...
19 Sep 2018 by sai sruthi
Hi, I have a doubt. I have a singleton object of an interface defined in the Autofac container. I use this object across my solution. I need to access the interface inside custom authorize attribute and I need to resolve the dependency. What I have tried: I have tried sending it through...
9 Nov 2018 by dada2010
Hello everybody i have problems with some code : I try to cache some value from a config file in the global.asax, with a timer. The global goal of the project is to check some data and push messages for all webusers (via SignalR) every 20s. i add dependency on a file, but when updating this...
21 Apr 2020 by Vikash Vyas
I had converted the WPF installer to the English to Portuguese (Brazil) also set the prerequisite. While I build the setup project it gives an error related to the Microsoft framework and 'Visual C++ "14" Runtime Libraries (x64)' ERROR: To...
21 Apr 2020 by Richard Deeming
That runtime language pack can be downloaded from: Download .NET Framework 4.7.2 - PTB Language Pack[^] There's a list of available language packs under "Advanced downloads" on this page: Download .NET Framework 4.7.2 | Free official downloads[^]
10 May 2021 by Member 15076657
I'm trying to run an .exe. When it runs, it shows the following error. Error occurred during initialization of VM Unable to load native library: Can't find dependent libraries What does this mean? JNIEnv* create_vm(JavaVM** jvm) { //JavaVM*...
9 May 2021 by OriginalGriff
If you don't understand an error message, Google it: Error occurred during initialization of VM Unable to load native library: Can't find dependent libraries - Google Search[^] What it means is that a DLL is missing, or incompatible with the...
10 May 2021 by Richard MacCutchan
OK, I have a working version, which required a couple of minor changes: #include JNIEnv* create_vm(JavaVM** jvm) { //JavaVM* jvm; /* denotes a Java VM */ JNIEnv* env; /* pointer to native method interface */ JavaVMInitArgs...
14 Jul 2021 by Member 14192879
I want to create a pdf of the current xamarin form. I used pdf sharp and itext7 to implement it but unable to do it. but below code only capture the text of xamarin, not the image. i just want to save currently viewed xamarin form to pdf. I am...
8 Jan 2023 by reverser69
hi all i have a target app written in Java. i want to call one of its functions. im using Intellij Idea. i imported its dependencies. wrote a few lines of code and till now, i have two problems. 1. i get: Exception in thread "main"...
8 Jan 2023 by Richard MacCutchan
1. See the discussion at https://stackoverflow.com/questions/34855649/invalid-signature-file-digest-for-manifest-main-attributes-exception-while-tryin[^]. 2. The log4j library is not part of a the standard Java libraries, so you need to include...
13 Mar 2023 by Masis Levin
Redis with .NET | Redis Documentation Center[^]
9 Oct 2023 by Maloda 2022
Using WildFly 29, I followed the quickstart guide for the EJB-Multi-Server at the wildfly quickstart github Let' s supposes I have two EJB projects A and B I am already able to call B from A via a JNDI lookup But when I setup B to be able to...
10 Oct 2023 by OriginalGriff
If you have two projects called A and B, and A references B while B also references A which do you build first? If you build A, then B you end up with A being out of date because B has changed. But when you build A, B becomes out of date so...
23 Nov 2023 by Richard MacCutchan
See my comment to your duplicate of this question.
14 Dec 2015 by Ciumac Sergiu
A simple way of using dependency injection and service locator in you class library
8 May 2014 by Halil ibrahim Kalkan
An implementation of dependency injection, repository and unit of work patterns using Castle Windsor and NHibernate.
21 Jan 2013 by Simeon Sheye
How to manage state and simulate behavior against the system under test.
27 Jan 2014 by Shivprasad koirala
In this article we will try to understand SOLID Architecture principles using simple C# examples.
26 Feb 2019 by L. Michael
This article provides a recipe on how to avoid producing legacy code at the speed of typing by using a proper architecture and unit testing.
25 Aug 2015 by K. Naveen. Bhat
The article shows how we can solve various technical problems easily with the help of delegates.
7 Feb 2014 by Pranay Rana
What is dependency injection and why there is need of this software design pattern.
21 Mar 2015 by Priyank Modi
In Depth Look: Strategy Design Pattern, Dependency Injection (DI), Open/Closed principle (OCP) and Loose Coupling vs Tight Coupling
17 Nov 2015 by Emmanuel Nuyttens
Example of a multi purpose Layered framework for simplifying modern .NET application development
14 Nov 2012 by turbosqel
Simple code to make your components always fit exact size of Form, during and after resize.
13 Oct 2016 by MaDOnos
Adapter implemantation to mock DbContext easily
28 Apr 2020 by Chinmaya C
Explanation about DIP and its need in the real time scenario
27 Oct 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Of course, as the name suggests, it is the upcoming version of ASP.NET.
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.
10 Aug 2016 by Aless Alessio
Design your solution and code your classes as loosely-coupled objects. Learn how to use MOQ and Ninject for mocking your Service and injecting it at runtime with Ninject.
12 Jun 2015 by Charaf Dadoua
SQL dependency with C#.NET and SQL Server 2012
6 May 2017 by Habibur Rony
This topic will cover the concept of the adapter pattern & how to implement logger using log4net. It will also cover what’s adapter pattern, why need, where & when to use; what’s Log4Net, implementation of logger using adapter pattern, how to implement and add custom SMTP appender & configuration.
9 May 2016 by xszaboj
Dependecy injection with ninja
22 Sep 2016 by Alexandros Pappas
This project provides utilities for SQL server, such as executing a list of SQL scripts, exporting data to an SQL script, and displaying relationships between records.
14 Mar 2013 by Andreas Gieriet
How about Dependency Injection?The interface is defined in a LibAContract and a LibBContract or even in a shared LibContract.LibA and LibB depend both on that contract lib and implement the respective contract.CheersAndi