DotNetDynamicInjector 3.0.0

dotnet add package DotNetDynamicInjector --version 3.0.0                
NuGet\Install-Package DotNetDynamicInjector -Version 3.0.0                
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="DotNetDynamicInjector" Version="3.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetDynamicInjector --version 3.0.0                
#r "nuget: DotNetDynamicInjector, 3.0.0"                
#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.
// Install DotNetDynamicInjector as a Cake Addin
#addin nuget:?package=DotNetDynamicInjector&version=3.0.0

// Install DotNetDynamicInjector as a Cake Tool
#tool nuget:?package=DotNetDynamicInjector&version=3.0.0                

DotNet.DynamicInjector

Dynamic dependency injector for external project DLLs

Dynamically reference external dlls without the need to add them to the project. Leave your project with low dependency and allowing specific dlls according to your business rule or database parameters.

This is the component, works on .NET Core and.NET Framework

Info

Code Quality Build Nuget Contributors
Codacy Badge Build NuGet GitHub contributors

Platform Support

DotNet.DynamicInjector is a .NET Standard 2.0 library.

Using DynamicInjector

The dlls that should be referenced by default must be in the compiled project folder

Use the service configuration in the startup of your ASP.NET core project


services.RegisterDynamicDependencies(ioCConfiguration);

IoCConfiguration contains the configuration of your dependency injection. It is possible to specify only the namespaces you want to reference, ignoring others in the project


var ioCConfiguration = new IoCConfiguration()
{
   AllowedInterfaceNamespaces = 
       new List<string> {"Mynamespance1", "Mynamespance2"}
};

IoCRole configures the dll and type of dependency you want to automatically inject


var role = new IoCRole
 {
     Dll = "MyProject.dll", //DLL name
     Implementation = "My Implementation", // Implementation name, can be used for a control if you use several projects and wanted to separate them
     Priority = 1, // Priority that the dll should be loaded
     LifeTime = LifeTime.SCOPED, // Lifetime of your addiction injection
    Name = "My client business rule x" //Dependency name. It is used only for identification
  };
            
    ioCConfiguration.Roles.Add(role);

Samples coming soon ..

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
3.0.0 123 4/18/2024
2.0.1 506 7/26/2022
1.2.0 364 8/31/2021
1.1.0 2,608 8/17/2020
1.0.0 465 7/30/2020

update References for .net 8