Ninject.Extensions.DependencyInjection 1.0.0-beta

This is a prerelease version of Ninject.Extensions.DependencyInjection.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Ninject.Extensions.DependencyInjection --version 1.0.0-beta
                    
NuGet\Install-Package Ninject.Extensions.DependencyInjection -Version 1.0.0-beta
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ninject.Extensions.DependencyInjection" Version="1.0.0-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ninject.Extensions.DependencyInjection" Version="1.0.0-beta" />
                    
Directory.Packages.props
<PackageReference Include="Ninject.Extensions.DependencyInjection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ninject.Extensions.DependencyInjection --version 1.0.0-beta
                    
#r "nuget: Ninject.Extensions.DependencyInjection, 1.0.0-beta"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ninject.Extensions.DependencyInjection@1.0.0-beta
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ninject.Extensions.DependencyInjection&version=1.0.0-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Ninject.Extensions.DependencyInjection&version=1.0.0-beta&prerelease
                    
Install as a Cake Tool

This repo is based on https://github.com/lord-executor/Ninject.Web.AspNetCore which has the original work.

GitHub CI

Overview

This project provides full Ninject integration with ASP.NET Core projects. Full integration means that the Ninject kernel is used to replace the standard service provider that comes with ASP.NET Core.

  • Ninject.Extensions.DependencyInject
  • Ninject.Extensions.DependencyInjection.AspNetCore - this is only required if you use .InRequestScope().

Examples

Simple Program.cs

using Microsoft.AspNetCore.Builder;
using Ninject.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Ninject;

var builder = WebApplication.CreateBuilder(args);

builder.Host
    .UseServiceProviderFactory(new NinjectServiceProviderFactory())
    .ConfigureContainer<IKernel>(kernel =>
    {
        // Ninject Binding here
        // kernel.Bind<IServiceA>().To<ServiceA>();
    });

// ServiceCollection Binding here
// builder.Services
//    .AddTransient<IServiceB, ServiceB>();

builder.Services.AddMvc();

var app = builder.Build();

app.UseRouting()
    .UseEndpoints(endpoints => endpoints.MapControllers());

await app.RunAsync().ConfigureAwait(false);

With Startup.cs file

public class Startup
{
    public static void Configure(IApplicationBuilder app)
    {
        app.UseRouting()
           .UseEndpoints(endpoints => endpoints.MapControllers());
    }

    public static void ConfigureServices(IServiceCollection services)
    {
        // ServiceCollection Binding here
        // builder.Services
        //    .AddTransient<IServiceB, ServiceB>();
        
        services.AddMvc();
    }

    public static void ConfigureContainer(IKernel builder)
    {
	    // Ninject Binding here
        // kernel.Bind<IServiceA>().To<ServiceA>();
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Ninject.Extensions.DependencyInjection:

Package Downloads
Ninject.Extensions.DependencyInjection.AspNetCore

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 40,433 8/2/2023
1.0.1-beta 271 7/31/2023
1.0.0-beta 241 7/29/2023