CodeBrix.ServiceLocator.MsplLicenseForever 1.0.242.982

There is a newer version of this package available.
See the version list below for details.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package CodeBrix.ServiceLocator.MsplLicenseForever --version 1.0.242.982
                    
NuGet\Install-Package CodeBrix.ServiceLocator.MsplLicenseForever -Version 1.0.242.982
                    
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="CodeBrix.ServiceLocator.MsplLicenseForever" Version="1.0.242.982" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeBrix.ServiceLocator.MsplLicenseForever" Version="1.0.242.982" />
                    
Directory.Packages.props
<PackageReference Include="CodeBrix.ServiceLocator.MsplLicenseForever" />
                    
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 CodeBrix.ServiceLocator.MsplLicenseForever --version 1.0.242.982
                    
#r "nuget: CodeBrix.ServiceLocator.MsplLicenseForever, 1.0.242.982"
                    
#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 CodeBrix.ServiceLocator.MsplLicenseForever@1.0.242.982
                    
#: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=CodeBrix.ServiceLocator.MsplLicenseForever&version=1.0.242.982
                    
Install as a Cake Addin
#tool nuget:?package=CodeBrix.ServiceLocator.MsplLicenseForever&version=1.0.242.982
                    
Install as a Cake Tool

CodeBrix.ServiceLocator

A fully managed service-location abstraction library for .NET — a faithful port of CommonServiceLocator 2.0.7 into the CodeBrix.ServiceLocator namespace, intended as a drop-in replacement for the CommonServiceLocator NuGet package. It provides a shared interface over IoC containers and service locators, so an application can resolve services indirectly without taking a hard reference on any specific container. CodeBrix.ServiceLocator has no dependencies other than .NET, and is provided as a .NET 10 library and associated CodeBrix.ServiceLocator.MsplLicenseForever NuGet package.

CodeBrix.ServiceLocator supports applications and assemblies that target Microsoft .NET version 10.0 and later. Microsoft .NET version 10.0 is a Long-Term Supported (LTS) version of .NET, and was released on Nov 11, 2025; and will be actively supported by Microsoft until Nov 14, 2028. Please update your C#/.NET code and projects to the latest LTS version of Microsoft .NET.

CodeBrix.ServiceLocator supports:

  • IServiceLocator — the shared abstraction for resolving services by type or by type + name, including GetInstance, GetInstance<TService>, GetAllInstances, and GetAllInstances<TService>.
  • ServiceLocator — a static ambient-container accessor (ServiceLocator.Current, ServiceLocator.SetLocatorProvider, ServiceLocator.IsLocationProviderSet).
  • ServiceLocatorImplBase — an abstract base that implements the full IServiceLocator surface in terms of two DoGetInstance / DoGetAllInstances template methods, so a container adapter only needs to implement two methods.
  • ActivationException — the standard exception raised when service resolution fails (resolution errors thrown by the underlying container are wrapped in it).
  • ServiceLocatorProvider — the delegate used to supply the ambient container to ServiceLocator.

The public type-for-type surface matches CommonServiceLocator 2.0.7, so migrating is largely a namespace change from CommonServiceLocator to CodeBrix.ServiceLocator.

Sample Code

Implement a container adapter and use the ambient accessor

using System;
using System.Collections.Generic;
using CodeBrix.ServiceLocator;

// 1. Adapt your IoC container by deriving from ServiceLocatorImplBase.
public sealed class MyContainerAdapter : ServiceLocatorImplBase
{
    protected override object DoGetInstance(Type serviceType, string key)
        => /* resolve a single service from your container */;

    protected override IEnumerable<object> DoGetAllInstances(Type serviceType)
        => /* resolve all registered services of serviceType */;
}

// 2. Register it as the ambient container.
ServiceLocator.SetLocatorProvider(() => new MyContainerAdapter());

// 3. Resolve services anywhere via the ambient accessor.
var service = ServiceLocator.Current.GetInstance<IMyService>();

License

The project is licensed under the MS-PL License. see: https://en.wikipedia.org/wiki/Microsoft_Public_License

CodeBrix.ServiceLocator is a derivative work of CommonServiceLocator (MS-PL). Its copyright/attribution notice and the full MS-PL license text are reproduced in THIRD-PARTY-NOTICES.txt.

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

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on CodeBrix.ServiceLocator.MsplLicenseForever:

Package Downloads
CodeBrix.Platform.ApacheLicenseForever

The core CodeBrix.Platform UI package for desktop apps (C# and XAML on .NET 10 / Skia). Self-contained: bundles the CodeBrix.Platform Foundation, WinRT, Dispatching and Foundation.Logging assemblies.

CodeBrix.Platform.Extensions.ApacheLicenseForever

A .NET Standard 2.0 and .NET 10 bundle of the core nventive Uno.Core.Extensions helper libraries (general extensions, collections, disposables, equality, logging, and threading), namespace-renamed into CodeBrix.Platform.Extensions.* for use by CodeBrix.Platform and its consumers. Multi-targets netstandard2.0 (e.g. for Roslyn source generators) and net10.0. Vendors the source of Uno.Core.Extensions, .Collections, .Disposables, .Equality, .Logging, .Logging.Singleton, and .Threading at version 4.1.1.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.242.1047 43 8/30/2026