System.Composition 11.0.0-preview.4.26230.115

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.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/bf8791d0d1be92c24e56cefa52aa139e2b5340c2.
167
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/fa72fa61b0d822ea8a3fbeb96f668340419ab5cd.
172
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.
159
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/e68227ea677b76a3c603bd616f03ea6d952b2458.
161
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/fa72fa61b0d822ea8a3fbeb96f668340419ab5cd.
162
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/1ce8866c9de4c2d67351ef6863699dee03b0804a.
193
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.
158
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/2ad4aabc7a9dada097e54e544ebba48ab1c05074
167
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
164
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/49a655e40d938aa74b1d149b407c30cbb2287d71.
169
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/50bd09a9eefdf9bc3653dbf6d9624b31a023c7c0.
169
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/5f00f4d6ffb242a337e21a196aab0593891e430e.
158
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.
213
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.
262
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/92790e24cc2b9f9e336ed0365d610e106c01df88.
156
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/db94f4cc8c78a7cd8cf9cfdae091158d2ba9d974.
158
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.
180
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.
424
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/8edf7bcd4f1594c3d68a6a567469f41dbd33dd1b.
159
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.
164

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

.NET 10.0

.NET Standard 2.0

.NET Framework 4.6.2

.NET 11.0

Version Downloads Last updated
11.0.0-preview.4.26230.115 6 05/12/2026
11.0.0-preview.3.26207.106 11 04/14/2026
11.0.0-preview.2.26159.112 17 03/11/2026
11.0.0-preview.1.26104.118 23 02/12/2026
10.0.8 5 05/13/2026
10.0.7 14 04/21/2026
10.0.6 15 04/14/2026
10.0.5 17 03/15/2026
10.0.4 15 03/11/2026
10.0.3 27 02/12/2026
10.0.2 25 01/13/2026
10.0.1 29 12/13/2025
10.0.0 56 11/12/2025
10.0.0-rc.2.25502.107 67 10/15/2025
10.0.0-rc.1.25451.107 74 09/10/2025
10.0.0-preview.7.25380.108 70 08/14/2025
10.0.0-preview.6.25358.103 86 07/17/2025
10.0.0-preview.5.25277.114 71 06/07/2025
10.0.0-preview.4.25258.110 87 05/16/2025
10.0.0-preview.3.25171.5 96 04/13/2025
10.0.0-preview.2.25163.2 98 04/01/2025
10.0.0-preview.1.25080.5 94 04/01/2025
9.0.16 4 05/12/2026
9.0.15 12 04/14/2026
9.0.14 18 03/11/2026
9.0.13 22 02/12/2026
9.0.12 21 01/13/2026
9.0.11 55 11/11/2025
9.0.10 76 10/15/2025
9.0.9 93 09/10/2025
9.0.8 72 08/05/2025
9.0.7 80 07/09/2025
9.0.6 105 06/12/2025
9.0.5 96 05/17/2025
9.0.4 103 04/10/2025
9.0.3 88 03/31/2025
9.0.2 98 03/31/2025
9.0.1 97 04/01/2025
9.0.0 113 11/14/2024
9.0.0-rc.2.24473.5 90 10/22/2024
9.0.0-rc.1.24431.7 96 09/19/2024
9.0.0-preview.7.24405.7 94 08/18/2024
9.0.0-preview.6.24327.7 116 07/18/2024
9.0.0-preview.5.24306.7 123 07/18/2024
9.0.0-preview.4.24266.19 109 07/18/2024
9.0.0-preview.3.24172.9 122 07/18/2024
9.0.0-preview.2.24128.5 116 07/18/2024
9.0.0-preview.1.24080.9 113 07/18/2024
8.0.0 111 07/18/2024
8.0.0-rc.2.23479.6 114 07/18/2024
8.0.0-rc.1.23419.4 122 07/18/2024
8.0.0-preview.7.23375.6 119 07/18/2024
8.0.0-preview.6.23329.7 122 07/18/2024
8.0.0-preview.5.23280.8 120 07/18/2024
8.0.0-preview.4.23259.5 115 07/18/2024
8.0.0-preview.3.23174.8 119 07/18/2024
8.0.0-preview.2.23128.3 122 07/18/2024
8.0.0-preview.1.23110.8 123 07/18/2024
7.0.0 447 02/05/2024
7.0.0-rc.2.22472.3 113 07/18/2024
7.0.0-rc.1.22426.10 129 07/18/2024
7.0.0-preview.7.22375.6 123 07/18/2024
7.0.0-preview.6.22324.4 120 07/18/2024
7.0.0-preview.5.22301.12 126 07/18/2024
7.0.0-preview.4.22229.4 121 07/18/2024
7.0.0-preview.3.22175.4 143 07/18/2024
7.0.0-preview.2.22152.2 122 07/18/2024
7.0.0-preview.1.22076.8 138 07/18/2024
6.0.2-mauipre.1.22102.15 83 01/10/2025
6.0.2-mauipre.1.22054.8 102 04/08/2025
6.0.0 221 02/04/2024
6.0.0-rc.2.21480.5 116 07/18/2024
6.0.0-rc.1.21451.13 126 07/18/2024
6.0.0-preview.7.21377.19 140 07/18/2024
6.0.0-preview.6.21352.12 110 07/18/2024
6.0.0-preview.5.21301.5 127 07/18/2024
6.0.0-preview.4.21253.7 123 07/18/2024
6.0.0-preview.3.21201.4 103 07/18/2024
6.0.0-preview.2.21154.6 119 07/18/2024
6.0.0-preview.1.21102.12 118 07/18/2024
5.0.1 129 07/18/2024
5.0.0 122 07/18/2024
5.0.0-rc.2.20475.5 112 07/18/2024
5.0.0-rc.1.20451.14 124 07/18/2024
5.0.0-preview.8.20407.11 127 07/18/2024
5.0.0-preview.7.20364.11 128 07/18/2024
5.0.0-preview.6.20305.6 126 07/18/2024
5.0.0-preview.5.20278.1 124 07/18/2024
5.0.0-preview.4.20251.6 115 07/18/2024
5.0.0-preview.3.20214.6 123 07/18/2024
5.0.0-preview.2.20160.6 119 07/18/2024
5.0.0-preview.1.20120.5 112 07/18/2024
1.4.1 138 07/18/2024
1.4.0 112 07/18/2024
1.4.0-preview3.19551.4 124 07/18/2024
1.4.0-preview2.19523.17 120 07/18/2024
1.4.0-preview1.19504.10 150 07/18/2024
1.3.0 131 07/18/2024
1.3.0-rc1.19456.4 106 07/18/2024
1.3.0-preview9.19421.4 110 07/18/2024
1.3.0-preview9.19416.11 121 07/18/2024
1.3.0-preview8.19405.3 120 07/18/2024
1.3.0-preview7.19362.9 119 07/18/2024
1.3.0-preview6.19303.8 123 07/18/2024
1.3.0-preview6.19264.9 111 07/18/2024
1.3.0-preview5.19224.8 126 07/18/2024
1.3.0-preview4.19212.13 133 07/18/2024
1.3.0-preview3.19128.7 119 07/18/2024
1.3.0-preview.19073.11 126 07/18/2024
1.3.0-preview.18571.3 119 07/18/2024
1.2.0 124 07/18/2024
1.2.0-rc1 143 07/18/2024
1.2.0-preview2-26406-04 122 07/18/2024
1.2.0-preview1-26216-02 120 07/18/2024
1.1.0 117 07/18/2024
1.1.0-preview2-25405-01 129 07/18/2024
1.1.0-preview1-25305-02 120 07/18/2024
1.0.31 148 02/04/2024
1.0.31-preview1-24530-04 117 07/18/2024