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
<PackageReference Include="CodeBrix.ServiceLocator.MsplLicenseForever" Version="1.0.242.1047" />
<PackageVersion Include="CodeBrix.ServiceLocator.MsplLicenseForever" Version="1.0.242.1047" />
<PackageReference Include="CodeBrix.ServiceLocator.MsplLicenseForever" />
paket add CodeBrix.ServiceLocator.MsplLicenseForever --version 1.0.242.1047
#r "nuget: CodeBrix.ServiceLocator.MsplLicenseForever, 1.0.242.1047"
#:package CodeBrix.ServiceLocator.MsplLicenseForever@1.0.242.1047
#addin nuget:?package=CodeBrix.ServiceLocator.MsplLicenseForever&version=1.0.242.1047
#tool nuget:?package=CodeBrix.ServiceLocator.MsplLicenseForever&version=1.0.242.1047
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 through1.0.242.982usedCodeBrix.ServiceLocator; every later version usesCodeBrix.ServiceLocation. Writeusing 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 enclosingCodeBrixnamespace, so in any consumer whose own namespace began withCodeBrix.the bare nameServiceLocatorbound to the namespace and hid the class, failing with CS0234. Because versions here are date-stamped (major pinned to1), 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, 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.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 | Versions 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. |
-
.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 | 0 | 8/30/2026 |