System.Composition 9.0.23

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
205
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.
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/04c76c9d58c7911e2fd199da145cd97bbf283438.
161
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.
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/7a63d79b60ffb33e919bee8056816f8f449d00ce.
151
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.
151
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.
149
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.
148
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.
148
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
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/c3b512958589fecf9e847a73db492cfc92f71a69.
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/47b0a1e0ab831076eda00bb1e24b9d042d256e17.
146
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.
146
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.
146
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.
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/66772aff549b2981094175a6f2f69600596c1913.
145
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.
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/2ac1568063fc4e4501d63f8aba329023080a66ba.
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/ebbf56c257fb4d3128d3487ef525d92e9f94b412.
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/4c32f5e4e9c0828a94fd4d1c9c0994082c85aaf3.
144

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