CodeBrix.ServiceLocator.MsplLicenseForever 1.0.242.1047

dotnet add package CodeBrix.ServiceLocator.MsplLicenseForever --version 1.0.242.1047
                    
NuGet\Install-Package CodeBrix.ServiceLocator.MsplLicenseForever -Version 1.0.242.1047
                    
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.1047" />
                    
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.1047" />
                    
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.1047
                    
#r "nuget: CodeBrix.ServiceLocator.MsplLicenseForever, 1.0.242.1047"
                    
#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.1047
                    
#: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.1047
                    
Install as a Cake Addin
#tool nuget:?package=CodeBrix.ServiceLocator.MsplLicenseForever&version=1.0.242.1047
                    
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.ServiceLocation 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.

Breaking change — the namespace is CodeBrix.ServiceLocation. Package versions through 1.0.242.982 used CodeBrix.ServiceLocator; every later version uses CodeBrix.ServiceLocation. Write using CodeBrix.ServiceLocation;. Nothing else changed — same types, same members, same behavior, same package id and assembly name. The old namespace was a member of the enclosing CodeBrix namespace, so in any consumer whose own namespace began with CodeBrix. the bare name ServiceLocator bound to the namespace and hid the class, failing with CS0234. Because versions here are date-stamped (major pinned to 1), this break cannot show up as a major-version bump — expect a compile error instead.

CodeBrix.ServiceLocator has no dependencies other than .NET, and is provided as a .NET Standard 2.0 / .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, and — via its .NET Standard 2.0 target — downlevel consumers such as Roslyn source generators and analyzers. 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.ServiceLocation.

Sample Code

Implement a container adapter and use the ambient accessor

using System;
using System.Collections.Generic;
using CodeBrix.ServiceLocation;

// 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 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.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.
  • .NETStandard 2.0

    • No dependencies.
  • 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 34 8/30/2026