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/df45061e218c9b5813c5531bc06fb238a23e30f6.
3,739
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/8de9e4b2beba5b7c0edd6f1e6a4f192a51fdc872.
974
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/6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3.
923
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/81d9274600db701a8b08ed8af3fd6b00a775cc33.
851
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/34202cc2f3e869fd70a26d8237f4552cf9e192cf.
521
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
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/66a912c9463eebe832cf742d2fe8bb2e1a4600ec.
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/e595ee276d14e14bfb3eb323fb57f2aa668bddea
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/20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e.
20
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/431de5f2dab8829ad9e4ac5e65a87c11253be7c7.
20
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/f5ba9f2c61a2fe853dc4913888d40df221539147.
19
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/473e349f86b0f5c9dd47330cba22e0ea225c85a5.
19
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.
19
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/82f2e2541478e239dc4b04f231e90dc2b3dcb422.
19
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/9d88fee4efb9f7ae4ae053d63b9f8b5b31217c90.
18
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/20a4c9adb4fd8317c968157ef11add1fbceccacc.
18
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/9d80dea7fe1b14043b9b2ac4d0b59ed26f508742.
18
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/8e1779e16298415843e85029d8b52a1ae9bb4c30.
18
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/c3cc1d0ceeab1a65da0217e403851a1e8a30086a.
18
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/15b43b33901c88f68ef43f8314b5a2457716780d.
18

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

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