System.Composition 9.0.17

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
29
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.
28
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.
28
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/1deafee3682da88bf07d1c18521a99f47446cee8.
28
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.
28
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.
28
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.
28
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
28
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/28e49407a6e4744819bd471707259b99964e441c.
28
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/cc0d213b15fdda217ad888d269d19754fa556eb4.
28
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/2f760738cb92f32f50c981b68ba04ac3c8b7ee48.
28
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/76398adb17bed731280dd869e8b03b2b04cd1f67.
28
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.
28
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/9081e399a13297f6e2fd37cb06ca82ffba3eed21
28
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/bff1470cd9b1d44df8450e794bed97a64657c2a7
28
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/b9fb1610c87cccc8ceb74a770dba261a58e39c4a.
28
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/2b7d172669b2f7e55803b55f317cfcc2d4279d76.
28
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/75e79dace86b274327a1afe479228d82a06051a4.
28
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/091091276de5136e94e4413faa87e4d4ec3a7671.
28
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.
28

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

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