System.Composition
9.0.0-rc.2.24473.5
Prefix Reserved
See the version list below for details.
dotnet add package System.Composition --version 9.0.0-rc.2.24473.5
NuGet\Install-Package System.Composition -Version 9.0.0-rc.2.24473.5
<PackageReference Include="System.Composition" Version="9.0.0-rc.2.24473.5" />
paket add System.Composition --version 9.0.0-rc.2.24473.5
#r "nuget: System.Composition, 9.0.0-rc.2.24473.5"
// Install System.Composition as a Cake Addin #addin nuget:?package=System.Composition&version=9.0.0-rc.2.24473.5&prerelease // Install System.Composition as a Cake Tool #tool nuget:?package=System.Composition&version=9.0.0-rc.2.24473.5&prerelease
About
Provides the Managed Extensibility Framework (MEF) 2.0, a lightweight, attribute-driven Dependency Injection (DI) container.
MEF simplifies the composition of applications by allowing components to be loosely coupled and dynamically discovered. This package supports the development of modular and maintainable applications by enabling parts to be composed at runtime.
Key Features
- Components are discovered and composed using attributes.
- Provides dependency injection capabilities for loosely coupled modules.
How to Use
Running code from a discovered component.
using System.Composition;
using System.Composition.Hosting;
var configuration = new ContainerConfiguration().WithPart<Service>();
using var container = configuration.CreateContainer();
var service = container.GetExport<Service>();
service.Execute();
// Output: Service is running!
[Export]
public class Service
{
public void Execute() => Console.WriteLine("Service is running!");
}
Main Types
The main types provided by this library are:
System.Composition.ExportAttribute
System.Composition.ImportAttribute
System.Composition.Convention.ConventionBuilder
System.Composition.Hosting.CompositionHost
System.Composition.CompositionContext
System.Composition.CompositionContextExtensions
Additional Documentation
Related Packages
- System.Composition.AttributedModel
- System.Composition.Convention
- System.Composition.Hosting
- System.Composition.Runtime
- System.Composition.TypedParts
Feedback & Contributing
System.Composition is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
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. |
.NET Core | netcoreapp2.0 is compatible. 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 is compatible. 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. |
-
.NETFramework 4.6.2
- System.Composition.AttributedModel (>= 9.0.0-rc.2.24473.5)
- System.Composition.Convention (>= 9.0.0-rc.2.24473.5)
- System.Composition.Hosting (>= 9.0.0-rc.2.24473.5)
- System.Composition.Runtime (>= 9.0.0-rc.2.24473.5)
- System.Composition.TypedParts (>= 9.0.0-rc.2.24473.5)
-
.NETStandard 2.0
- System.Composition.AttributedModel (>= 9.0.0-rc.2.24473.5)
- System.Composition.Convention (>= 9.0.0-rc.2.24473.5)
- System.Composition.Hosting (>= 9.0.0-rc.2.24473.5)
- System.Composition.Runtime (>= 9.0.0-rc.2.24473.5)
- System.Composition.TypedParts (>= 9.0.0-rc.2.24473.5)
-
net8.0
- System.Composition.AttributedModel (>= 9.0.0-rc.2.24473.5)
- System.Composition.Convention (>= 9.0.0-rc.2.24473.5)
- System.Composition.Hosting (>= 9.0.0-rc.2.24473.5)
- System.Composition.Runtime (>= 9.0.0-rc.2.24473.5)
- System.Composition.TypedParts (>= 9.0.0-rc.2.24473.5)
-
net9.0
- System.Composition.AttributedModel (>= 9.0.0-rc.2.24473.5)
- System.Composition.Convention (>= 9.0.0-rc.2.24473.5)
- System.Composition.Hosting (>= 9.0.0-rc.2.24473.5)
- System.Composition.Runtime (>= 9.0.0-rc.2.24473.5)
- System.Composition.TypedParts (>= 9.0.0-rc.2.24473.5)
NuGet packages (166)
Showing the top 5 NuGet packages that depend on System.Composition:
Package | Downloads |
---|---|
Microsoft.CodeAnalysis.Workspaces.Common
A shared package used by the .NET Compiler Platform ("Roslyn") including support for analyzing projects and solutions. Do not install this package manually, it will be added as a prerequisite by other packages that require it. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/dfa7fc6bdea31a858a402168384192b633c811fa. |
|
Microsoft.CodeAnalysis.CSharp.Workspaces
.NET Compiler Platform ("Roslyn") support for analyzing C# projects and solutions. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/dfa7fc6bdea31a858a402168384192b633c811fa. |
|
Microsoft.CodeAnalysis.VisualBasic.Workspaces
.NET Compiler Platform ("Roslyn") support for analyzing Visual Basic projects and solutions. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/dfa7fc6bdea31a858a402168384192b633c811fa. |
|
Microsoft.CodeAnalysis.Features
.NET Compiler Platform ("Roslyn") support for creating editing experiences. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/dfa7fc6bdea31a858a402168384192b633c811fa. |
|
Microsoft.CodeAnalysis.CSharp.Features
.NET Compiler Platform ("Roslyn") support for creating C# editing experiences. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/dfa7fc6bdea31a858a402168384192b633c811fa. |
GitHub repositories (55)
Showing the top 5 popular GitHub repositories that depend on System.Composition:
Repository | Stars |
---|---|
BeyondDimension/SteamTools
🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
|
|
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
|
|
JustArchiNET/ArchiSteamFarm
C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
|
|
dotnet/machinelearning
ML.NET is an open source and cross-platform machine learning framework for .NET.
|
|
dotnet/docfx
Static site generator for .NET API documentation.
|