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.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/069a85a786acae3be2c7b49e330b7f968a624c88.
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/154af84a603094b52bd08b3366c4448f7481af52.
28
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.
25
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/20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e.
23
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/29e657c0582904529bae2a87c227220e03f509cf.
27
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.
28
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/5429b35d5a4359cbf4815f3563cdc4de13dae1be
24
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/572b1f0e0da95fd92af710ee58c95e2257cb08e3.
42
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/65df6b1065bae316232a6c9907a8be995302fb5e.
42
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/713efb0e68d34ab75faaf709e071e5c2d8d4ed0e.
59
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/7d47461d2ddd32defbc51c2cf0e75a3fef16c3d7.
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/9bc8f80f8272bd000a642c1a09ffbf30b287d9c5.
44
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/ae1fff344d46976624e68ae17164e0607ab68b10.
25
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.
49
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.
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/edd2de88fb3e84a097fb30b4070e0f219f624e40.
32
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/fa8e2c9b566e4471a3509fc63d7baca0a2a6d30b.
64
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
60
Microsoft.VisualStudio.Composition
Lightning fast MEF engine, supporting System.ComponentModel.Composition and System.Composition.
22
Microsoft.VisualStudio.Composition
Lightning fast MEF engine, supporting System.ComponentModel.Composition and System.Composition.
24

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET Standard 2.0

.NET 9.0

.NET 8.0

Version Downloads Last updated
9.0.0-rc.2.24473.5 5 10/10/2024
9.0.0-rc.1.24431.7 8 09/11/2024
9.0.0-preview.7.24405.7 8 08/14/2024
9.0.0-preview.6.24327.7 8 07/10/2024
9.0.0-preview.5.24306.7 7 06/16/2024
9.0.0-preview.4.24266.19 9 05/24/2024
9.0.0-preview.3.24172.9 8 04/18/2024
9.0.0-preview.2.24128.5 11 03/14/2024
9.0.0-preview.1.24080.9 12 03/14/2024
8.0.0 11 11/16/2023
8.0.0-rc.2.23479.6 8 10/13/2023
8.0.0-rc.1.23419.4 11 09/14/2023
8.0.0-preview.7.23375.6 9 10/02/2023
8.0.0-preview.6.23329.7 8 10/02/2023
8.0.0-preview.5.23280.8 11 06/18/2023
8.0.0-preview.4.23259.5 13 06/10/2023
8.0.0-preview.3.23174.8 18 05/14/2023
8.0.0-preview.2.23128.3 19 04/09/2023
8.0.0-preview.1.23110.8 31 04/03/2023
7.0.0 55 12/19/2022
7.0.0-rc.2.22472.3 54 10/15/2022
7.0.0-rc.1.22426.10 35 09/22/2022
7.0.0-preview.7.22375.6 45 09/26/2022
7.0.0-preview.6.22324.4 85 09/22/2022
7.0.0-preview.5.22301.12 27 09/21/2022
7.0.0-preview.4.22229.4 42 09/23/2022
7.0.0-preview.3.22175.4 29 09/23/2022
7.0.0-preview.2.22152.2 31 09/24/2022
7.0.0-preview.1.22076.8 31 09/25/2022
6.0.2-mauipre.1.22102.15 63 09/21/2022
6.0.2-mauipre.1.22054.8 22 10/15/2022
6.0.0 66 09/15/2022
6.0.0-rc.2.21480.5 31 09/24/2022
6.0.0-rc.1.21451.13 50 09/22/2022
6.0.0-preview.7.21377.19 68 09/25/2022
6.0.0-preview.6.21352.12 28 09/22/2022
6.0.0-preview.5.21301.5 40 09/24/2022
6.0.0-preview.4.21253.7 51 09/25/2022
6.0.0-preview.3.21201.4 61 09/23/2022
6.0.0-preview.2.21154.6 66 09/23/2022
6.0.0-preview.1.21102.12 66 09/26/2022
5.0.1 62 09/14/2022
5.0.0 23 09/13/2022
5.0.0-rc.2.20475.5 26 09/22/2022
5.0.0-rc.1.20451.14 43 09/24/2022
5.0.0-preview.8.20407.11 51 09/22/2022
5.0.0-preview.7.20364.11 41 09/27/2022
5.0.0-preview.6.20305.6 74 09/23/2022
5.0.0-preview.5.20278.1 45 09/26/2022
5.0.0-preview.4.20251.6 58 09/23/2022
5.0.0-preview.3.20214.6 36 09/25/2022
5.0.0-preview.2.20160.6 38 09/23/2022
5.0.0-preview.1.20120.5 89 09/24/2022
1.4.1 45 09/13/2022
1.4.0 48 09/14/2022
1.4.0-preview3.19551.4 20 09/22/2022
1.4.0-preview2.19523.17 15 09/25/2022
1.4.0-preview1.19504.10 74 10/15/2022
1.3.0 22 09/14/2022
1.3.0-rc1.19456.4 41 09/25/2022
1.3.0-preview9.19421.4 70 10/15/2022
1.3.0-preview9.19416.11 63 09/24/2022
1.3.0-preview8.19405.3 29 09/24/2022
1.3.0-preview7.19362.9 41 09/24/2022
1.3.0-preview6.19303.8 32 09/22/2022
1.3.0-preview6.19264.9 34 09/24/2022
1.3.0-preview5.19224.8 37 09/22/2022
1.3.0-preview4.19212.13 33 09/22/2022
1.3.0-preview3.19128.7 33 09/22/2022
1.3.0-preview.19073.11 41 09/22/2022
1.3.0-preview.18571.3 54 09/22/2022
1.2.0 40 09/13/2022
1.2.0-rc1 50 09/16/2022
1.2.0-preview2-26406-04 56 09/22/2022
1.2.0-preview1-26216-02 39 09/23/2022
1.1.0 67 09/14/2022
1.1.0-preview2-25405-01 53 09/21/2022
1.1.0-preview1-25305-02 57 09/25/2022
1.0.31 29 06/27/2022
1.0.31-preview1-24530-04 25 09/22/2022