Click here to Skip to main content
15,891,316 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 Title

Dependency 

21 Jan 2013 by Simeon Sheye
How to manage state and simulate behavior against the system under test.
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.
24 Apr 2017 by Habibur Rony
This topic will cover the bad design practice using STUPID and good design practice using SOLID. Detailed explanation for Single Single Responsibility Principle, Open and Closed Principle, Liskov Substitution Principle, Interface Segregation Principle and Dependency Inversion (DI) Principle.
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.
7 Jul 2016 by Zebedee Mason
Software for automatically constructing architecture diagrams and metrics from source code and .NET assemblies is presented. Examples for Visual C++, Python, the Linux kernel, Boost and .NET are discussed.
9 Nov 2015 by Oetawan
Extend ASP.NET MVC behavior to auto wire controller dependency
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 .
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...
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...
6 Aug 2014 by DannyVarod
Fast, stable and powerful creation of NuGet packages
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 =...
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...
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
14 Mar 2013 by Sergey Alexandrovich Kryukov
In addition to the answer by Andreas Gieriet:http://en.wikipedia.org/wiki/Dependency_injection[^].—SA
23 Nov 2023 by PinkGoat_
I'm having some issues here. So I wrote this method in a class named MainWindow, that exports logs of an app to a txt. Honestly I dont know if its good but anyways we will see. public void exportLogs () { string logsFolder =...
23 Nov 2023 by Richard MacCutchan
See my comment to your duplicate of this question.
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...
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';...
7 Jun 2016 by GProssliner
cobj is a preprocessor based generator for interface based polymorphism
8 Dec 2018 by Sharp Ninja
Simple Dependency Injection, the customizable way. Learn about the SimpleDI framework for creating simple and effective dependency injection.
11 Jun 2015 by Lance Contreras
Create an easily resusable IconBlock (TextBlock that display's an icon)
25 Apr 2013 by danait25
Hi,I used this tool as Kenneth Haugland recommended me:WPF-Drawing-Canvas-Controland I have a problem that I guess is pretty simple..On the class DrawingCanvas there's a custom control #Region "Constructor" Sub New() ...
28 Apr 2013 by danait25
deleted that part from my constructor and it worked fine- 'defaultStyleKeyProperty.OverrideMetadata(GetType(DrawingCanvas), _ 'New FrameworkPropertyMetadata(GetType(DrawingCanvas)))
17 Aug 2023 by temuco
All under .NET 7.0 Given is a custom library isential.crypt.dll that contains no external dependencies. A NuGet package was created from it and stored in a local package source. A second custom library named isential.MySqloverSsh.dll uses three...
16 Aug 2023 by temuco
I noticed that there is a difference between the version of a NuGet package and the version of the assembly it contains. Previously, I had set the assembly version to "1.0.*", which meant that it was automatically incremented with each build....
12 Nov 2016 by Zebedee Mason
Perform dependency analysis by using Doxygen to parse source code and produce a report
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...
8 May 2014 by Halil ibrahim Kalkan
An implementation of dependency injection, repository and unit of work patterns using Castle Windsor and NHibernate.
4 Mar 2016 by zhshqzyc
I have a class which use dependency injection.public class BoerpiDebitAccountBalanceRetriever : IDebitAccountBalanceRetriever { private readonly IAccountInfo _MyDebitAccountInfo; public Exception ServiceException { get; set; } public...
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,...
7 Feb 2014 by Pranay Rana
What is dependency injection and why there is need of this software design pattern.
19 Feb 2018 by syed shanu
How to use Dependency Injection in ASP.NET Core 2.0 and use the result to bind in our View page
14 Dec 2015 by Ciumac Sergiu
A simple way of using dependency injection and service locator in you class library
10 May 2015 by AhmedYehiaK
I ask about if i can do something like that://In classlib1.dllclass Context : IdentityDbContext { .............}//In classlib2.dllclass MyUser : IdentityUser{ extend IdentityUser.......}Dependency injection registration:=> When you find...
10 May 2015 by Sergey Alexandrovich Kryukov
Please see my comment to the question. As your post does not make a real question, there is nothing to answer to.However, I can give you a couple of hints. First, did you pay attention that you Content class is non-generic? Why? Secondly, here is how the derived classes are...
28 Dec 2016 by Fiyaz Hasan
Learn how dependency injection mechanism has evolved from ASP.NET to ASP.NET Core
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.
28 Apr 2020 by Chinmaya C
Explanation about DIP and its need in the real time scenario
9 Oct 2012 by akchandra9
what are the advantages of Dependency Property. where it is used in wpf? sample code?
9 Oct 2012 by Santhosh Kumar Jayaraman
The purpose of dependency properties is to provide a way to compute the value of a property based on the value of other inputs. These other inputs might include system properties such as themes and user preference, just-in-time property determination mechanisms such as data binding and...
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...
28 Dec 2015 by Purbasha Ghosh
Initialize MVC controllers with multiple instance resolutions of same interface
7 Jul 2018 by hiimda95
I have problem when I build project WindowsForm application Dependency Injection. Here this is my code in Program.cs file. var builder = new ContainerBuilder(); builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly()); // Register your Web API controllers....
7 Jul 2018 by hiimda95
I fixed that. I made a mistake when I create UnitOfWork file. constructor of it must be create public.
9 Jan 2013 by Allgaeuer
Hello everyone,i experienced the following very strange behavior/difference in Visual Studio 2003 and 2010:Two seperate projects will be created in VS2003. One of them is build as a MFC extension DLL (named MFC_Extension_DLL) and the other one is build as a MFC DLL (named MFC_USINGDLL)....
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.
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?[^]
17 Apr 2017 by Gary Harpaz
Dependency injection frameworks are bad practice. So how can we still use dependency injection? Just do it yourself!
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
3 Sep 2013 by Nitin Singh India
How to identify dependencies and resolve them using Unity App Block. Simple Hello World.
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[^]
17 Nov 2015 by Emmanuel Nuyttens
Example of a multi purpose Layered framework for simplifying modern .NET application development
23 Mar 2013 by RogerDeNIro
Hi,i need help for my problem.i will create an *.dll which includes all graphical resources. The WinForm Project get the *.dll is depends.Thats work well but when i change something on the *.dll it doesnt work anymore.in attachment the sample project.When somebody can...
24 Mar 2013 by RogerDeNIro
@ThePhantomUpvoter:you are right, so here the project details, chane the archive and hope with the virustotal scan someone helps me
22 Jun 2012 by jgauffin
Griffin.Container: Introducing the Command Support
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?
23 Jan 2014 by Christian Graus
By writing code, and designing things so that they are modular. That means creating a framework that accepts plugins that impliment a base class, and extending that base class to create plug ins.
8 Mar 2023 by Khushboo Dewani
what is the code for add data in redis database using hash datatype of redis in C# asp.net core 3.1?Also what is the concept of master key in it? I have to analyse the code for add in api and rewrite the code for add so that my data should be...
13 Mar 2023 by Masis Levin
Redis with .NET | Redis Documentation Center[^]
14 Jul 2023 by Member 16050394
I have updated jackson dependency version in my maven project from 2.7.4 to 2.15.0 due to vulnerabilities in older versions. After updating I am getting an exception NoClassDefFoundError. I tried to use jackson BOM 2.15.0 but still getting that...
25 Sep 2012 by M_Mogharrabi
Hi all,How can i add dependencies of a windows service by installshield?My winservice depend on the three following services, so they must run before the service starts:1. COMSysApp2. SENS3. MSDTCNote: I have used Installshield project to install my service and not windows...
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[^]
1 Oct 2012 by M_Mogharrabi
I have solved it myself by adding the dependencies in ServiceComponent Wizard.
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.
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...
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...
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...
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.
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...
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....
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[^].
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
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...
13 Jan 2014 by Jeremy Likness
Learn how to perform interception of services using Angular's decorator feature.
3 Dec 2015 by Gaurav K Rastogi
This is the article which basically is the comparison between three most popular DIs in .NET.
19 Nov 2012 by chuckdawit
Hi everyone,Would this considered to be object dependency?SomeMethod(SerializationInfo info){ this.SomeInterfaceIHaveDeclaredAbove = (SomeConcreteObject)info.GetValue("someName", typeof(SomeConcreteObject));}If so should I make the concrete objects as interfaces like...
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...
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!
1 Mar 2015 by Bankey Sharma
Some general guidelines to make application source agnostic and business adaptive
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.
13 Oct 2016 by MaDOnos
Adapter implemantation to mock DbContext easily
2 Dec 2009 by ASP.NET Community
Observer pattern
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...
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...
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...
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...