Jehoel.AspNetDependencyInjection.WebApi 4.0.0

There is a newer prerelease version of this package available.
See the version list below for details.
Install-Package Jehoel.AspNetDependencyInjection.WebApi -Version 4.0.0
dotnet add package Jehoel.AspNetDependencyInjection.WebApi --version 4.0.0
<PackageReference Include="Jehoel.AspNetDependencyInjection.WebApi" Version="4.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jehoel.AspNetDependencyInjection.WebApi --version 4.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jehoel.AspNetDependencyInjection.WebApi, 4.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Jehoel.AspNetDependencyInjection.WebApi as a Cake Addin
#addin nuget:?package=Jehoel.AspNetDependencyInjection.WebApi&version=4.0.0

// Install Jehoel.AspNetDependencyInjection.WebApi as a Cake Tool
#tool nuget:?package=Jehoel.AspNetDependencyInjection.WebApi&version=4.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


(Currently listed on 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 using Unity, located at

  • This particular package's main objective is supporting ASP.NET Web Forms 4.7.2's new WebObjectActivator which means that Page, 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
  • 2.0 - My Unity.WebForms project, updated in 2019 for ASP.NET 4.7.2 and WebObjectActivator). See
  • 3.0 - After being extensively modified to use Microsoft.Extensions.DependencyInjection and renamed to AspNetDependencyInjection (as it now is unrelated to Unity.
  • 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 file in the GitHub repository:

References / Links

Here are some of the sources used for building out this package:



AspNetDependencyInjection and all related prior projects are licensed under the MIT license -

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.0-beta2 172 7/20/2021
5.0.0-beta01 165 7/19/2021
4.0.0 1,329 10/22/2019

Targets .NET 4.7.2