Jehoel.AspNetDependencyInjection
4.0.0
See the version list below for details.
dotnet add package Jehoel.AspNetDependencyInjection --version 4.0.0
NuGet\Install-Package Jehoel.AspNetDependencyInjection -Version 4.0.0
<PackageReference Include="Jehoel.AspNetDependencyInjection" Version="4.0.0" />
paket add Jehoel.AspNetDependencyInjection --version 4.0.0
#r "nuget: Jehoel.AspNetDependencyInjection, 4.0.0"
// Install Jehoel.AspNetDependencyInjection as a Cake Addin #addin nuget:?package=Jehoel.AspNetDependencyInjection&version=4.0.0 // Install Jehoel.AspNetDependencyInjection as a Cake Tool #tool nuget:?package=Jehoel.AspNetDependencyInjection&version=4.0.0
AspNetDependencyInjection
(Currently listed on NuGet.org as Jehoel.AspNetDependencyInjection
and Jehoel.AspNetDependencyInjection.Mvc
)
AspNetDependencyInjection allows "Classic" ASP.NET Web Forms applications to use Microsoft.Extensions.DependencyInjection
to compose application services.
This project is derived from my earlier
Unity.WebForms
project which provided DI usingUnity
, located at https://github.com/Jehoel/Unity.WebForms.- ...which itself is a derivative and fork of S. Kyle Korndoerfer's original project at https://bitbucket.org/KyleK/unity.webforms
- ...which cites DevTrends Unity.MVC3 and DevTrends Unity.WCF as original works.
- ...which itself is a derivative and fork of S. Kyle Korndoerfer's original project at https://bitbucket.org/KyleK/unity.webforms
This particular package's main objective is supporting ASP.NET Web Forms 4.7.2's new
WebObjectActivator
which means thatPage
,UserControl
and other types can use true constructor dependency injection. Previously applications had to use "property injection" which many consider to be an anti-pattern.This project is not intended for use with ASP.NET Web API, ASP.NET 5, nor ASP.NET Core. Those platforms already have established dependency-injection infrastructure ecosystems available to their users.
AspNetDependencyInjection.Mvc exposes AspNetDependencyInjection
as an implementation of System.Web.Mvc.IDependencyResolver
for use with ASP.NET MVC 5.x.
Current Version
- 1.4 - S. Kyle Korndoerfer's most recent version of
Unity.WebForms
, released in 2015. See https://bitbucket.org/KyleK/unity.webforms. - 2.0 - My
Unity.WebForms
project, updated in 2019 for ASP.NET 4.7.2 and WebObjectActivator). See https://github.com/Jehoel/Unity.WebForms. - 3.0 - After being extensively modified to use
Microsoft.Extensions.DependencyInjection
and renamed toAspNetDependencyInjection
(as it now is unrelated toUnity
. - 3.2 - Adding support for ASP.NET MVC (which turned out to be broken).
- 3.3 - Bugfixing ASP.NET MVC support.
- 4.0 - Major refactoring and API redesign. Adding support for SignalR (both scoped and unscoped) and ASP.NET Web API.
NuGet Gallery
Install-Package Jehoel.AspNetDependencyInjection
Install-Package Jehoel.AspNetDependencyInjection.Mvc
Installation and Getting Started
Please see the GETTING_STARTED.md
file in the GitHub repository: https://github.com/Jehoel/AspNetDependencyInjection/blob/master/GETTING_STARTED.md
References / Links
Here are some of the sources used for building out this package:
Unity.WebForms
:- Dependency Injection in ASP.NET WebForms - Mikael Lundin
- Unity: How to registerType with a PARAMETER constructor
- Unity.MVC3 - The linked articles on the bottom helped a lot with infrastructure
Jehoel.Unity.AspNetWebForms
:- Announcing the .NET Framework 4.7.2 - This article announced support for constructor-based DI.
- Use Dependency Injection In WebForms Application
- AspNetWebFormsDependencyInjection on Github
- Sample example of using AspNetWebFormsDependencyInjection - (Repository snapshot)
- Official Unity project for ASP.NET MVC
Copyright
- Copyright 2013 - 2015 S. Kyle Korndoerfer
- Copyright 2019 Dai Rees
License
AspNetDependencyInjection
and all related prior projects are licensed under the MIT license - http://www.opensource.org/licenses/mit-license
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Microsoft.Extensions.DependencyInjection (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 2.2.0)
- Microsoft.Web.Infrastructure (>= 1.0.0)
- WebActivatorEx (>= 2.2.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Jehoel.AspNetDependencyInjection:
Package | Downloads |
---|---|
Jehoel.AspNetDependencyInjection.WebApi
Dependency Injection in "Classic" ASP.NET WebForms, ASP.NET MVC, ASP.NET Web API, and ASP.NET-hosted WCF using Microsoft.Extensions.DependencyInjection. |
|
Jehoel.AspNetDependencyInjection.Mvc
Dependency Injection in "Classic" ASP.NET WebForms, ASP.NET MVC, ASP.NET Web API, and ASP.NET-hosted WCF using Microsoft.Extensions.DependencyInjection. |
|
Jehoel.AspNetDependencyInjection.SignalR
Dependency Injection in "Classic" ASP.NET WebForms, ASP.NET MVC, ASP.NET Web API, and ASP.NET-hosted WCF using Microsoft.Extensions.DependencyInjection. |
|
Jehoel.AspNetDependencyInjection.Wcf
Dependency Injection in "Classic" ASP.NET WebForms, ASP.NET MVC, ASP.NET Web API, and ASP.NET-hosted WCF using Microsoft.Extensions.DependencyInjection. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
5.0.0-beta2 | 8,188 | 7/20/2021 | |
5.0.0-beta01 | 912 | 7/19/2021 | |
4.0.0 | 89,461 | 10/22/2019 | |
3.4.0 | 1,208 | 8/20/2019 | |
3.3.0 | 1,091 | 8/17/2019 | |
3.2.0 | 1,239 | 8/15/2019 | |
3.0.0 | 1,177 | 8/15/2019 |
Targets .NET 4.7.2