System.Composition 9.0.0-rc.2.24473.5

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

Feedback & Contributing

System.Composition is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.Composition.

Packages Downloads
Microsoft.Composition
This packages provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web. Supported Platforms: - .NET Framework 4.5 - Windows 8 - Windows Phone 8.1 - Windows Phone Silverlight 8 - Portable Class Libraries
48
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/256d46e2333636eccd52866ca6f698f0ef4b9910.
43
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/1cb14195ed43eefdf7f9de59140ff6db70eea76e.
41
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/ebbf56c257fb4d3128d3487ef525d92e9f94b412.
41
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/04c76c9d58c7911e2fd199da145cd97bbf283438.
41
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/205504dfd0f686370cffae5df068024c8a2b427f.
41
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/e5eb71d6714749bccf91d9268ece78cd5d4d43ea.
40
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/091091276de5136e94e4413faa87e4d4ec3a7671.
39
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/9081e399a13297f6e2fd37cb06ca82ffba3eed21
38
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/7a63d79b60ffb33e919bee8056816f8f449d00ce.
38
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/2242fa4fb945b97680bdd49eb5dd58285e4abb1c.
38
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/ec4841263590f5456e32728d98097e97c1605e22.
38
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/4c32f5e4e9c0828a94fd4d1c9c0994082c85aaf3.
38
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/df45061e218c9b5813c5531bc06fb238a23e30f6.
38
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/4c7d79a254288388d97d793c4087db6ebf00d2fd.
37
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/b446afd34759150c2ea3b86ab794104e12e64db1.
36
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/182c1e333b8514ac17dc463aac26b5552977a040.
36
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/b3e69109341a1017423af7981b8b84b646f5bcce.
36
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/ec366687c8caead948e58704ad61ed644eb91b5b.
36
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/be223bbc06bdad4ee7e615ad32f18c40a10dea81.
36

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET Standard 2.0

Version Downloads Last updated
9.0.0-rc.2.24473.5 4 10/25/2024
9.0.0-rc.1.24431.7 10 9/12/2024
9.0.0-preview.7.24405.7 14 8/15/2024
9.0.0-preview.6.24327.7 18 7/10/2024
9.0.0-preview.5.24306.7 18 6/14/2024
9.0.0-preview.4.24266.19 12 6/5/2024
9.0.0-preview.3.24172.9 15 4/19/2024
9.0.0-preview.2.24128.5 18 3/26/2024
9.0.0-preview.1.24080.9 17 2/22/2024
8.0.0 21 11/15/2023
8.0.0-rc.2.23479.6 24 10/12/2023
8.0.0-rc.1.23419.4 29 9/21/2023
8.0.0-preview.7.23375.6 29 8/23/2023
8.0.0-preview.6.23329.7 30 8/3/2023
8.0.0-preview.5.23280.8 25 8/3/2023
8.0.0-preview.4.23259.5 24 5/20/2023
8.0.0-preview.3.23174.8 20 5/17/2023
8.0.0-preview.2.23128.3 26 8/24/2023
8.0.0-preview.1.23110.8 27 2/24/2023
7.0.0 28 12/6/2022
7.0.0-rc.2.22472.3 28 12/7/2022
7.0.0-rc.1.22426.10 26 9/17/2022
7.0.0-preview.7.22375.6 26 9/17/2022
7.0.0-preview.6.22324.4 30 9/17/2022
7.0.0-preview.5.22301.12 27 6/30/2022
7.0.0-preview.4.22229.4 32 6/30/2022
7.0.0-preview.3.22175.4 23 6/30/2022
7.0.0-preview.2.22152.2 31 6/30/2022
7.0.0-preview.1.22076.8 31 6/30/2022
6.0.2-mauipre.1.22102.15 32 6/30/2022
6.0.2-mauipre.1.22054.8 33 6/30/2022
6.0.0 31 6/30/2022
6.0.0-rc.2.21480.5 32 6/30/2022
6.0.0-rc.1.21451.13 24 6/30/2022
6.0.0-preview.7.21377.19 29 6/30/2022
6.0.0-preview.6.21352.12 32 6/30/2022
6.0.0-preview.5.21301.5 26 6/30/2022
6.0.0-preview.4.21253.7 32 6/30/2022
6.0.0-preview.3.21201.4 27 6/30/2022
6.0.0-preview.2.21154.6 33 6/30/2022
6.0.0-preview.1.21102.12 31 6/30/2022
5.0.1 26 6/30/2022
5.0.0 25 6/30/2022
5.0.0-rc.2.20475.5 27 6/30/2022
5.0.0-rc.1.20451.14 30 6/30/2022
5.0.0-preview.8.20407.11 31 6/30/2022
5.0.0-preview.7.20364.11 30 6/30/2022
5.0.0-preview.6.20305.6 30 6/30/2022
5.0.0-preview.5.20278.1 31 6/30/2022
5.0.0-preview.4.20251.6 32 6/30/2022
5.0.0-preview.3.20214.6 27 6/30/2022
5.0.0-preview.2.20160.6 32 6/30/2022
5.0.0-preview.1.20120.5 30 6/30/2022
1.4.1 25 6/30/2022
1.4.0 31 6/30/2022
1.4.0-preview3.19551.4 32 6/30/2022
1.4.0-preview2.19523.17 30 6/30/2022
1.4.0-preview1.19504.10 30 6/30/2022
1.3.0 33 6/30/2022
1.3.0-rc1.19456.4 36 6/30/2022
1.3.0-preview9.19421.4 39 6/30/2022
1.3.0-preview9.19416.11 38 6/30/2022
1.3.0-preview8.19405.3 32 6/30/2022
1.3.0-preview7.19362.9 25 6/30/2022
1.3.0-preview6.19303.8 28 6/30/2022
1.3.0-preview6.19264.9 30 6/30/2022
1.3.0-preview5.19224.8 29 6/30/2022
1.3.0-preview4.19212.13 29 6/30/2022
1.3.0-preview3.19128.7 31 6/30/2022
1.3.0-preview.19073.11 29 6/30/2022
1.3.0-preview.18571.3 33 6/30/2022
1.2.0 29 6/30/2022
1.2.0-rc1 27 6/30/2022
1.2.0-preview2-26406-04 32 6/30/2022
1.2.0-preview1-26216-02 31 6/30/2022
1.1.0 25 6/30/2022
1.1.0-preview2-25405-01 29 6/30/2022
1.1.0-preview1-25305-02 29 6/30/2022
1.0.31 31 6/30/2022
1.0.31-preview1-24530-04 31 6/30/2022