System.Composition 10.0.10

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/6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3.
1,244
Microsoft.CodeAnalysis.Workspaces.MSBuild
.NET Compiler Platform ("Roslyn") support for analyzing MSBuild projects and solutions. This should be used with at least one of the following packages to add the appropriate language support: - Microsoft.CodeAnalysis.CSharp.Workspaces - Microsoft.CodeAnalysis.VisualBasic.Workspaces More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/6c4a46a31302167b425d5e0a31ea83c9a9aa1d09.
660
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/6c4a46a31302167b425d5e0a31ea83c9a9aa1d09.
649
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/6c4a46a31302167b425d5e0a31ea83c9a9aa1d09.
646
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/bde21ee2b98b775b010d01a93f81ef587fe80962.
49
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/5e3a11e2e7f952da93f9d35bd63a2fa181c0608b.
48
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.
46
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
45
Microsoft.CodeAnalysis.Workspaces.MSBuild
.NET Compiler Platform ("Roslyn") support for analyzing MSBuild projects and solutions. This should be used with at least one of the following packages to add the appropriate language support: - Microsoft.CodeAnalysis.CSharp.Workspaces - Microsoft.CodeAnalysis.VisualBasic.Workspaces More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/e68227ea677b76a3c603bd616f03ea6d952b2458.
44
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/16f9bd284cd49604ac82998bfe778a8eb16d4347.
44
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/75e79dace86b274327a1afe479228d82a06051a4.
43
Microsoft.CodeAnalysis.Workspaces.MSBuild
.NET Compiler Platform ("Roslyn") support for analyzing MSBuild projects and solutions. This should be used with at least one of the following packages to add the appropriate language support: - Microsoft.CodeAnalysis.CSharp.Workspaces - Microsoft.CodeAnalysis.VisualBasic.Workspaces More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/fa72fa61b0d822ea8a3fbeb96f668340419ab5cd.
43
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/2b7d172669b2f7e55803b55f317cfcc2d4279d76.
42
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/1ff281352c76f1a56ae8e49af9c4c4ef0e0f0f42.
42
Microsoft.CodeAnalysis.Workspaces.MSBuild
.NET Compiler Platform ("Roslyn") support for analyzing MSBuild projects and solutions. This should be used with at least one of the following packages to add the appropriate language support: - Microsoft.CodeAnalysis.CSharp.Workspaces - Microsoft.CodeAnalysis.VisualBasic.Workspaces More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/16f9bd284cd49604ac82998bfe778a8eb16d4347.
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/34202cc2f3e869fd70a26d8237f4552cf9e192cf.
41
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/2b7d172669b2f7e55803b55f317cfcc2d4279d76.
41
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/8edf7bcd4f1594c3d68a6a567469f41dbd33dd1b.
41
Microsoft.CodeAnalysis
.NET Compiler Platform ("Roslyn"). This is the all-in-one package (a superset of all assemblies). You can install any of these sub-packages if you only want part of the functionality: - "Microsoft.CodeAnalysis.CSharp.Workspaces" (C# compiler + services) - "Microsoft.CodeAnalysis.VisualBasic.Workspaces" (VB compiler + services) - "Microsoft.CodeAnalysis.Compilers" (both compilers) - "Microsoft.CodeAnalysis.CSharp" (only the C# compiler) - "Microsoft.CodeAnalysis.VisualBasic (only the VB compiler) More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/bf8791d0d1be92c24e56cefa52aa139e2b5340c2.
41
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/75e79dace86b274327a1afe479228d82a06051a4.
41

Version Downloads Last updated
11.0.0-preview.6.26359.118 1 07/22/2026
11.0.0-preview.5.26302.115 15 06/12/2026
11.0.0-preview.4.26230.115 22 05/13/2026
11.0.0-preview.3.26207.106 21 04/15/2026
11.0.0-preview.2.26159.112 22 03/14/2026
11.0.0-preview.1.26104.118 37 02/12/2026
10.0.10 2 07/20/2026
10.0.9 11 06/12/2026
10.0.8 17 05/14/2026
10.0.7 20 04/21/2026
10.0.6 25 04/15/2026
10.0.5 35 03/14/2026
10.0.4 27 03/14/2026
10.0.3 33 02/12/2026
10.0.2 32 01/16/2026
10.0.1 35 12/12/2025
10.0.0 30 12/12/2025
10.0.0-rc.2.25502.107 34 12/12/2025
10.0.0-rc.1.25451.107 30 12/12/2025
10.0.0-preview.7.25380.108 27 12/12/2025
10.0.0-preview.6.25358.103 35 12/12/2025
10.0.0-preview.5.25277.114 33 12/12/2025
10.0.0-preview.4.25258.110 26 12/12/2025
10.0.0-preview.3.25171.5 28 12/13/2025
10.0.0-preview.2.25163.2 26 12/20/2025
10.0.0-preview.1.25080.5 24 12/12/2025
9.0.18 3 07/19/2026
9.0.17 9 06/12/2026
9.0.16 20 05/14/2026
9.0.15 26 04/15/2026
9.0.14 30 03/14/2026
9.0.13 26 02/12/2026
9.0.12 28 01/16/2026
9.0.11 29 12/12/2025
9.0.10 37 12/12/2025
9.0.9 33 12/12/2025
9.0.8 29 12/20/2025
9.0.7 28 12/20/2025
9.0.6 38 12/12/2025
9.0.5 28 01/08/2026
9.0.4 25 12/20/2025
9.0.3 27 12/17/2025
9.0.2 29 12/20/2025
9.0.1 31 12/12/2025
9.0.0 643 12/19/2025
9.0.0-rc.2.24473.5 19 12/10/2025
9.0.0-rc.1.24431.7 26 12/20/2025
9.0.0-preview.7.24405.7 30 12/12/2025
9.0.0-preview.6.24327.7 27 12/20/2025
9.0.0-preview.5.24306.7 15 12/20/2025
9.0.0-preview.4.24266.19 26 12/20/2025
9.0.0-preview.3.24172.9 21 12/20/2025
9.0.0-preview.2.24128.5 22 12/20/2025
9.0.0-preview.1.24080.9 21 12/20/2025
8.0.0 28 12/20/2025
8.0.0-rc.2.23479.6 23 12/20/2025
8.0.0-rc.1.23419.4 26 12/13/2025
8.0.0-preview.7.23375.6 27 12/10/2025
8.0.0-preview.6.23329.7 26 12/20/2025
8.0.0-preview.5.23280.8 18 12/20/2025
8.0.0-preview.4.23259.5 29 12/20/2025
8.0.0-preview.3.23174.8 20 12/14/2025
8.0.0-preview.2.23128.3 24 12/20/2025
8.0.0-preview.1.23110.8 22 12/16/2025
7.0.0 35 12/10/2025
7.0.0-rc.2.22472.3 32 12/20/2025
7.0.0-rc.1.22426.10 27 12/12/2025
7.0.0-preview.7.22375.6 25 12/14/2025
7.0.0-preview.6.22324.4 28 12/19/2025
7.0.0-preview.5.22301.12 28 12/17/2025
7.0.0-preview.4.22229.4 23 12/20/2025
7.0.0-preview.3.22175.4 27 12/15/2025
7.0.0-preview.2.22152.2 20 12/20/2025
7.0.0-preview.1.22076.8 28 12/20/2025
6.0.2-mauipre.1.22102.15 22 12/11/2025
6.0.2-mauipre.1.22054.8 28 01/03/2026
6.0.0 1,246 12/10/2025
6.0.0-rc.2.21480.5 28 12/20/2025
6.0.0-rc.1.21451.13 26 12/12/2025
6.0.0-preview.7.21377.19 30 12/15/2025
6.0.0-preview.6.21352.12 24 12/12/2025
6.0.0-preview.5.21301.5 27 12/16/2025
6.0.0-preview.4.21253.7 24 12/20/2025
6.0.0-preview.3.21201.4 17 12/20/2025
6.0.0-preview.2.21154.6 29 12/11/2025
6.0.0-preview.1.21102.12 18 12/12/2025
5.0.1 23 12/12/2025
5.0.0 23 12/12/2025
5.0.0-rc.2.20475.5 27 12/12/2025
5.0.0-rc.1.20451.14 32 12/12/2025
5.0.0-preview.8.20407.11 27 12/12/2025
5.0.0-preview.7.20364.11 19 12/12/2025
5.0.0-preview.6.20305.6 19 12/12/2025
5.0.0-preview.5.20278.1 21 12/12/2025
5.0.0-preview.4.20251.6 24 12/12/2025
5.0.0-preview.3.20214.6 23 12/12/2025
5.0.0-preview.2.20160.6 30 12/12/2025
5.0.0-preview.1.20120.5 18 12/12/2025
1.4.1 24 12/12/2025
1.4.0 28 12/12/2025
1.4.0-preview3.19551.4 28 12/12/2025
1.4.0-preview2.19523.17 21 12/20/2025
1.4.0-preview1.19504.10 18 12/16/2025
1.3.0 22 12/12/2025
1.3.0-rc1.19456.4 27 12/12/2025
1.3.0-preview9.19421.4 19 12/12/2025
1.3.0-preview9.19416.11 20 12/12/2025
1.3.0-preview8.19405.3 35 12/15/2025
1.3.0-preview7.19362.9 30 12/15/2025
1.3.0-preview6.19303.8 28 12/12/2025
1.3.0-preview6.19264.9 19 12/12/2025
1.3.0-preview5.19224.8 14 12/16/2025
1.3.0-preview4.19212.13 19 12/18/2025
1.3.0-preview3.19128.7 20 12/17/2025
1.3.0-preview.19073.11 21 12/12/2025
1.3.0-preview.18571.3 18 12/12/2025
1.2.0 30 12/12/2025
1.2.0-rc1 30 12/12/2025
1.2.0-preview2-26406-04 25 12/12/2025
1.2.0-preview1-26216-02 29 12/12/2025
1.1.0 22 12/12/2025
1.1.0-preview2-25405-01 26 12/12/2025
1.1.0-preview1-25305-02 25 12/12/2025
1.0.31 26 12/12/2025
1.0.31-preview1-24530-04 25 12/12/2025