RxSharpServiceLocator 8.0.4

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

RxSharpServiceLocator

A lightweight, modular, plug-and-play Dependency Injection framework for .NET.
Designed to be zero-config, compile-safe, and auto-healing.


๐Ÿ”ฅ Key Features

  • โœ… Zero configuration โ€” no registration needed
  • ๐Ÿง  Auto-injection using class inheritance
  • ๐Ÿ”’ Compile-time safety with enforced DI contract
  • ๐Ÿงฉ Modular and Area-based service separation
  • ๐Ÿ”„ Self-healing Resolve<T>() with auto-registration
  • ๐Ÿงผ No attributes, no startup bloat โ€” just code

๐Ÿš€ Quick Start

1. Define a DI Area

public enum AppArea
{
    Application,
    JobService
}

2. Create Your Root DI Container

public class AppDi : BaseDi<AppDi, AppService, AppProvider, AppArea> { }

3. Register Your Services

public class AppService(Action<Type, AppArea> reg) : SiblingOf<AppDi, AppProvider, AppArea>(reg, AppArea.Application)
{
    public override void InjectSingleton(IServiceCollection services)
    {
        services.AddSingleton<MyMainService>();
    }

    public override void InjectOther()
    {
        AddService<OtherModule>();
    }
}

4. Consume via Provider

public class AppProvider : SiblingOf<AppDi> 
{
    public MyMainService MainService => Di.Resolve<MyMainService>();
}

5. Use Anywhere with UseOf<TDi>

public class AppEntryPoint : UseOf<AppServiceDi>
{
    public void Run()
    {
        var logger = Resolve<AppLoggerService>();
        logger.Log("๐Ÿš€ App started successfully");
    }
}

๐Ÿงฉ Dependency Resolution

var service = AppDi.I.Resolve<MyMainService>();

Even if it's not explicitly registered, it will be auto-resolved if it inherits from SiblingOf<,> โœ…



๐Ÿ“ฆ NuGet

dotnet add package RxSharpServiceLocator

NuGet Package Link


๐Ÿ”— GitHub

Source Code on GitHub


๐Ÿ‘ค Author

Sourabh Maheshwari
GyanJaraHatke


๐Ÿ“œ License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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.