CodeBrix.ServiceLocator.MsplLicenseForever
1.0.179.175
dotnet add package CodeBrix.ServiceLocator.MsplLicenseForever --version 1.0.179.175
NuGet\Install-Package CodeBrix.ServiceLocator.MsplLicenseForever -Version 1.0.179.175
<PackageReference Include="CodeBrix.ServiceLocator.MsplLicenseForever" Version="1.0.179.175" />
<PackageVersion Include="CodeBrix.ServiceLocator.MsplLicenseForever" Version="1.0.179.175" />
<PackageReference Include="CodeBrix.ServiceLocator.MsplLicenseForever" />
paket add CodeBrix.ServiceLocator.MsplLicenseForever --version 1.0.179.175
#r "nuget: CodeBrix.ServiceLocator.MsplLicenseForever, 1.0.179.175"
#:package CodeBrix.ServiceLocator.MsplLicenseForever@1.0.179.175
#addin nuget:?package=CodeBrix.ServiceLocator.MsplLicenseForever&version=1.0.179.175
#tool nuget:?package=CodeBrix.ServiceLocator.MsplLicenseForever&version=1.0.179.175
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, includingGetInstance,GetInstance<TService>,GetAllInstances, andGetAllInstances<TService>.ServiceLocator— a static ambient-container accessor (ServiceLocator.Current,ServiceLocator.SetLocatorProvider,ServiceLocator.IsLocationProviderSet).ServiceLocatorImplBase— an abstract base that implements the fullIServiceLocatorsurface in terms of twoDoGetInstance/DoGetAllInstancestemplate 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 toServiceLocator.
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 | Versions 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. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 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. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.179.175 | 58 | 6/28/2026 |