System.Composition 10.0.0-preview.7.25380.108

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
.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/2b7d172669b2f7e55803b55f317cfcc2d4279d76.
34
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/dfa7fc6bdea31a858a402168384192b633c811fa.
37
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/e482b6e281d7db727fcb086ebbfae44dcba82c6d.
35
Microsoft.CodeAnalysis.CSharp.Features
.NET Compiler Platform ("Roslyn") support for creating C# 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.
34
Microsoft.CodeAnalysis.CSharp.Features
.NET Compiler Platform ("Roslyn") support for creating C# editing experiences. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/e68227ea677b76a3c603bd616f03ea6d952b2458.
35
Microsoft.CodeAnalysis.CSharp.Features
.NET Compiler Platform ("Roslyn") support for creating C# editing experiences. More details at https://aka.ms/roslyn-packages This package was built from the source at https://github.com/dotnet/roslyn/commit/fa72fa61b0d822ea8a3fbeb96f668340419ab5cd.
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/e482b6e281d7db727fcb086ebbfae44dcba82c6d.
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/069a85a786acae3be2c7b49e330b7f968a624c88.
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/2fc6a04980f800c59e8ede97e6ae294ff47d666e.
45
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.
66
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.
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/4bdc8414790101a4da120a92cc4bc0154ac787ca.
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/66a912c9463eebe832cf742d2fe8bb2e1a4600ec.
144
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.
45
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.
137
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.
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/e091728607ca0fc9efca55ccfb3e59259c6b5a0a.
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/2c94423e50a72aea8a4962d8722641d06bc88b13
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/e595ee276d14e14bfb3eb323fb57f2aa668bddea
304
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/e873e69306527a0424e97af2985370556f474019
43

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

.NET Framework 4.6.2

.NET Standard 2.0

.NET 10.0

.NET 9.0

.NET 8.0

Version Downloads Last updated
10.0.0-preview.7.25380.108 2 08/15/2025
10.0.0-preview.6.25358.103 4 07/21/2025
10.0.0-preview.5.25277.114 7 06/09/2025
10.0.0-preview.4.25258.110 8 05/15/2025
10.0.0-preview.3.25171.5 12 04/24/2025
10.0.0-preview.2.25163.2 13 03/30/2025
10.0.0-preview.1.25080.5 14 02/28/2025
9.0.8 2 08/11/2025
9.0.7 4 07/23/2025
9.0.6 7 06/14/2025
9.0.5 11 05/18/2025
9.0.4 11 04/25/2025
9.0.3 18 03/17/2025
9.0.2 13 02/28/2025
9.0.1 16 02/01/2025
9.0.0 15 11/17/2024
9.0.0-rc.2.24473.5 19 10/09/2024
9.0.0-rc.1.24431.7 19 09/16/2024
9.0.0-preview.7.24405.7 19 08/17/2024
9.0.0-preview.6.24327.7 21 07/16/2024
9.0.0-preview.5.24306.7 23 06/17/2024
9.0.0-preview.4.24266.19 17 05/24/2024
9.0.0-preview.3.24172.9 19 04/18/2024
9.0.0-preview.2.24128.5 18 03/16/2024
9.0.0-preview.1.24080.9 19 03/11/2024
8.0.0 23 02/05/2024
8.0.0-rc.2.23479.6 16 02/05/2024
8.0.0-rc.1.23419.4 42 02/05/2024
8.0.0-preview.7.23375.6 36 02/05/2024
8.0.0-preview.6.23329.7 21 02/05/2024
8.0.0-preview.5.23280.8 40 02/05/2024
8.0.0-preview.4.23259.5 20 02/05/2024
8.0.0-preview.3.23174.8 19 02/05/2024
8.0.0-preview.2.23128.3 40 02/05/2024
8.0.0-preview.1.23110.8 18 02/05/2024
7.0.0 18 02/05/2024
7.0.0-rc.2.22472.3 17 02/05/2024
7.0.0-rc.1.22426.10 22 02/07/2024
7.0.0-preview.7.22375.6 22 02/05/2024
7.0.0-preview.6.22324.4 21 02/05/2024
7.0.0-preview.5.22301.12 23 02/05/2024
7.0.0-preview.4.22229.4 24 02/05/2024
7.0.0-preview.3.22175.4 23 02/05/2024
7.0.0-preview.2.22152.2 23 02/05/2024
7.0.0-preview.1.22076.8 16 02/05/2024
6.0.2-mauipre.1.22102.15 21 02/05/2024
6.0.2-mauipre.1.22054.8 17 02/05/2024
6.0.0 18 02/05/2024
6.0.0-rc.2.21480.5 19 02/05/2024
6.0.0-rc.1.21451.13 22 02/07/2024
6.0.0-preview.7.21377.19 22 02/05/2024
6.0.0-preview.6.21352.12 20 02/05/2024
6.0.0-preview.5.21301.5 41 02/05/2024
6.0.0-preview.4.21253.7 20 02/05/2024
6.0.0-preview.3.21201.4 21 02/05/2024
6.0.0-preview.2.21154.6 17 02/05/2024
6.0.0-preview.1.21102.12 21 02/05/2024
5.0.1 27 02/05/2024
5.0.0 18 02/05/2024
5.0.0-rc.2.20475.5 21 02/05/2024
5.0.0-rc.1.20451.14 20 02/07/2024
5.0.0-preview.8.20407.11 20 02/05/2024
5.0.0-preview.7.20364.11 21 02/05/2024
5.0.0-preview.6.20305.6 20 02/05/2024
5.0.0-preview.5.20278.1 22 02/05/2024
5.0.0-preview.4.20251.6 19 02/05/2024
5.0.0-preview.3.20214.6 25 02/05/2024
5.0.0-preview.2.20160.6 18 02/05/2024
5.0.0-preview.1.20120.5 20 02/05/2024
1.4.1 19 02/05/2024
1.4.0 17 02/05/2024
1.4.0-preview3.19551.4 19 02/05/2024
1.4.0-preview2.19523.17 20 02/05/2024
1.4.0-preview1.19504.10 20 02/05/2024
1.3.0 22 02/05/2024
1.3.0-rc1.19456.4 16 02/05/2024
1.3.0-preview9.19421.4 40 02/05/2024
1.3.0-preview9.19416.11 24 02/05/2024
1.3.0-preview8.19405.3 44 02/05/2024
1.3.0-preview7.19362.9 17 02/05/2024
1.3.0-preview6.19303.8 39 02/05/2024
1.3.0-preview6.19264.9 21 02/05/2024
1.3.0-preview5.19224.8 21 02/05/2024
1.3.0-preview4.19212.13 20 02/05/2024
1.3.0-preview3.19128.7 18 02/05/2024
1.3.0-preview.19073.11 16 02/05/2024
1.3.0-preview.18571.3 22 02/05/2024
1.2.0 17 02/05/2024
1.2.0-rc1 20 02/05/2024
1.2.0-preview2-26406-04 22 02/05/2024
1.2.0-preview1-26216-02 22 02/05/2024
1.1.0 16 02/05/2024
1.1.0-preview2-25405-01 20 02/05/2024
1.1.0-preview1-25305-02 22 02/05/2024
1.0.31 506 07/04/2020
1.0.31-preview1-24530-04 20 02/05/2024