System.Composition 9.0.21

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.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
200
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/ec4841263590f5456e32728d98097e97c1605e22.
163
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.
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/8e1779e16298415843e85029d8b52a1ae9bb4c30.
153
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/7a63d79b60ffb33e919bee8056816f8f449d00ce.
147
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.
147
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.
145
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.
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. This package was built from the source at https://github.com/dotnet/roslyn/commit/281ac90b8b5dd9fd923a353afd4af74f3246ca5c
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/c3b512958589fecf9e847a73db492cfc92f71a69.
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/beada51586dedc46a7fe5ca381ffb10e2b177070.
143
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/256d46e2333636eccd52866ca6f698f0ef4b9910.
143
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.
143
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.
142
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/2fc92d84e746c3aab75f0930278ea6675cd5bb5c.
142
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/2ac1568063fc4e4501d63f8aba329023080a66ba.
142
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/47b0a1e0ab831076eda00bb1e24b9d042d256e17.
141
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/66772aff549b2981094175a6f2f69600596c1913.
141
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/ebbf56c257fb4d3128d3487ef525d92e9f94b412.
141
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.
140

Version Downloads Last updated
11.0.0-rc.3.26522.148 5 10/26/2026
11.0.0-rc.2.26504.105 11 10/14/2026
11.0.0-rc.1.26425.128 19 9/9/2026
11.0.0-preview.7.26381.103 20 8/13/2026
11.0.0-preview.6.26359.118 34 7/17/2026
11.0.0-preview.5.26302.115 25 6/12/2026
11.0.0-preview.4.26230.115 34 5/12/2026
11.0.0-preview.3.26207.106 34 5/4/2026
11.0.0-preview.2.26159.112 36 3/12/2026
11.0.0-preview.1.26104.118 36 2/14/2026
10.0.14 5 10/27/2026
10.0.13 10 10/14/2026
10.0.12 20 9/9/2026
10.0.11 22 8/13/2026
10.0.10 23 7/16/2026
10.0.9 28 6/13/2026
10.0.8 39 5/12/2026
10.0.7 34 5/4/2026
10.0.6 40 5/4/2026
10.0.5 37 3/14/2026
10.0.4 27 3/12/2026
10.0.3 40 2/14/2026
10.0.2 35 1/16/2026
10.0.1 40 12/12/2025
10.0.0 62 11/12/2025
10.0.0-rc.2.25502.107 77 10/17/2025
10.0.0-rc.1.25451.107 72 9/10/2025
10.0.0-preview.7.25380.108 91 8/13/2025
10.0.0-preview.6.25358.103 92 7/26/2025
10.0.0-preview.5.25277.114 86 6/8/2025
10.0.0-preview.4.25258.110 105 5/15/2025
10.0.0-preview.3.25171.5 98 4/11/2025
10.0.0-preview.2.25163.2 86 3/25/2025
10.0.0-preview.1.25080.5 105 2/27/2025
9.0.22 3 10/27/2026
9.0.21 15 10/14/2026
9.0.20 21 9/10/2026
9.0.19 24 8/13/2026
9.0.18 32 7/16/2026
9.0.17 33 6/13/2026
9.0.16 37 5/12/2026
9.0.15 29 5/4/2026
9.0.14 38 3/12/2026
9.0.13 37 2/14/2026
9.0.12 30 1/16/2026
9.0.11 60 11/12/2025
9.0.10 90 10/17/2025
9.0.9 91 9/10/2025
9.0.8 107 8/7/2025
9.0.7 93 7/13/2025
9.0.6 115 6/13/2025
9.0.5 105 5/16/2025
9.0.4 108 4/11/2025
9.0.3 110 3/15/2025
9.0.2 109 2/18/2025
9.0.1 129 1/18/2025
9.0.0 121 11/13/2024
9.0.0-rc.2.24473.5 99 10/25/2024
9.0.0-rc.1.24431.7 118 9/12/2024
9.0.0-preview.7.24405.7 109 8/15/2024
9.0.0-preview.6.24327.7 103 7/10/2024
9.0.0-preview.5.24306.7 114 6/14/2024
9.0.0-preview.4.24266.19 109 6/5/2024
9.0.0-preview.3.24172.9 120 4/19/2024
9.0.0-preview.2.24128.5 108 3/26/2024
9.0.0-preview.1.24080.9 116 2/22/2024
8.0.0 138 11/15/2023
8.0.0-rc.2.23479.6 109 10/12/2023
8.0.0-rc.1.23419.4 131 9/21/2023
8.0.0-preview.7.23375.6 120 8/23/2023
8.0.0-preview.6.23329.7 124 8/3/2023
8.0.0-preview.5.23280.8 121 8/3/2023
8.0.0-preview.4.23259.5 119 5/20/2023
8.0.0-preview.3.23174.8 126 5/17/2023
8.0.0-preview.2.23128.3 129 8/24/2023
8.0.0-preview.1.23110.8 136 2/24/2023
7.0.0 139 12/6/2022
7.0.0-rc.2.22472.3 116 12/7/2022
7.0.0-rc.1.22426.10 118 9/17/2022
7.0.0-preview.7.22375.6 124 9/17/2022
7.0.0-preview.6.22324.4 116 9/17/2022
7.0.0-preview.5.22301.12 119 6/30/2022
7.0.0-preview.4.22229.4 129 6/30/2022
7.0.0-preview.3.22175.4 112 6/30/2022
7.0.0-preview.2.22152.2 119 6/30/2022
7.0.0-preview.1.22076.8 126 6/30/2022
6.0.2-mauipre.1.22102.15 114 6/30/2022
6.0.2-mauipre.1.22054.8 133 6/30/2022
6.0.0 133 6/30/2022
6.0.0-rc.2.21480.5 123 6/30/2022
6.0.0-rc.1.21451.13 112 6/30/2022
6.0.0-preview.7.21377.19 125 6/30/2022
6.0.0-preview.6.21352.12 128 6/30/2022
6.0.0-preview.5.21301.5 125 6/30/2022
6.0.0-preview.4.21253.7 117 6/30/2022
6.0.0-preview.3.21201.4 115 6/30/2022
6.0.0-preview.2.21154.6 117 6/30/2022
6.0.0-preview.1.21102.12 116 6/30/2022
5.0.1 138 6/30/2022
5.0.0 139 6/30/2022
5.0.0-rc.2.20475.5 116 6/30/2022
5.0.0-rc.1.20451.14 113 6/30/2022
5.0.0-preview.8.20407.11 117 6/30/2022
5.0.0-preview.7.20364.11 126 6/30/2022
5.0.0-preview.6.20305.6 120 6/30/2022
5.0.0-preview.5.20278.1 116 6/30/2022
5.0.0-preview.4.20251.6 124 6/30/2022
5.0.0-preview.3.20214.6 125 6/30/2022
5.0.0-preview.2.20160.6 122 6/30/2022
5.0.0-preview.1.20120.5 121 6/30/2022
1.4.1 157 6/30/2022
1.4.0 132 6/30/2022
1.4.0-preview3.19551.4 124 6/30/2022
1.4.0-preview2.19523.17 125 6/30/2022
1.4.0-preview1.19504.10 123 6/30/2022
1.3.0 138 6/30/2022
1.3.0-rc1.19456.4 126 6/30/2022
1.3.0-preview9.19421.4 127 6/30/2022
1.3.0-preview9.19416.11 131 6/30/2022
1.3.0-preview8.19405.3 117 6/30/2022
1.3.0-preview7.19362.9 118 6/30/2022
1.3.0-preview6.19303.8 118 6/30/2022
1.3.0-preview6.19264.9 111 6/30/2022
1.3.0-preview5.19224.8 119 6/30/2022
1.3.0-preview4.19212.13 124 6/30/2022
1.3.0-preview3.19128.7 113 6/30/2022
1.3.0-preview.19073.11 124 6/30/2022
1.3.0-preview.18571.3 125 6/30/2022
1.2.0 130 6/30/2022
1.2.0-rc1 133 6/30/2022
1.2.0-preview2-26406-04 124 6/30/2022
1.2.0-preview1-26216-02 132 6/30/2022
1.1.0 120 6/30/2022
1.1.0-preview2-25405-01 125 6/30/2022
1.1.0-preview1-25305-02 123 6/30/2022
1.0.31 148 6/30/2022
1.0.31-preview1-24530-04 122 6/30/2022