System.Composition 9.0.0

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.
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/154af84a603094b52bd08b3366c4448f7481af52.
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/205504dfd0f686370cffae5df068024c8a2b427f.
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/20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e.
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/29e657c0582904529bae2a87c227220e03f509cf.
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/4c32f5e4e9c0828a94fd4d1c9c0994082c85aaf3.
31
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
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/572b1f0e0da95fd92af710ee58c95e2257cb08e3.
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/65df6b1065bae316232a6c9907a8be995302fb5e.
46
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.
67
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.
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/9bc8f80f8272bd000a642c1a09ffbf30b287d9c5.
47
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.
26
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.
52
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.
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/edd2de88fb3e84a097fb30b4070e0f219f624e40.
33
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.
69
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
62
Microsoft.VisualStudio.Composition
Lightning fast MEF engine, supporting System.ComponentModel.Composition and System.Composition.
24
Microsoft.VisualStudio.Composition
Lightning fast MEF engine, supporting System.ComponentModel.Composition and System.Composition.
25

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

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