System.Composition 9.0.0-rc.2.24473.5

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.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/be9c072e1c8a9e6701e34d796b1d68098d08feab.
6
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.
7
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/260d16a8ee0ab42d94d8dfdfe85a1279c85dcffd.
6
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.
6
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/431de5f2dab8829ad9e4ac5e65a87c11253be7c7.
6
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/572b1f0e0da95fd92af710ee58c95e2257cb08e3.
7
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/6544980c8335ce25d8959afd4b6ee308686fed53.
6
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/65df6b1065bae316232a6c9907a8be995302fb5e.
6
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/73165d0e9db050da8c46cc375565c9959a5f17e5.
6
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.
6
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/b1ee65518f91ba461aa80484ad2ada232afd1305.
6
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/be223bbc06bdad4ee7e615ad32f18c40a10dea81.
6
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/be9c072e1c8a9e6701e34d796b1d68098d08feab.
6
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/c94e32157c34fa777f674242cd08cfdc98737d62.
6
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/ce8ac3f71fa4c73b78cf8218d58b322bdbdfa1c9.
6
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.
7
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.
7
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/f5ba9f2c61a2fe853dc4913888d40df221539147.
7
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/fb3f812a3e4b7534bef784fa2df1c21d1f67864d.
6
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
6

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

.NET Framework 4.6.2

.NET Standard 2.0

.NET 9.0

.NET 8.0

Version Downloads Last updated
9.0.0 0 12.11.2024
9.0.0-rc.2.24473.5 3 20.10.2024
9.0.0-rc.1.24431.7 5 22.09.2024
9.0.0-preview.7.24405.7 6 22.09.2024
9.0.0-preview.6.24327.7 5 22.09.2024
9.0.0-preview.5.24306.7 4 29.10.2024
9.0.0-preview.4.24266.19 3 29.10.2024
9.0.0-preview.3.24172.9 6 22.09.2024
9.0.0-preview.2.24128.5 4 22.09.2024
9.0.0-preview.1.24080.9 4 22.09.2024
8.0.0 3 29.10.2024
8.0.0-rc.2.23479.6 4 22.09.2024
8.0.0-rc.1.23419.4 6 22.09.2024
8.0.0-preview.7.23375.6 4 22.09.2024
8.0.0-preview.6.23329.7 6 22.09.2024
8.0.0-preview.5.23280.8 5 22.09.2024
8.0.0-preview.4.23259.5 5 22.09.2024
8.0.0-preview.3.23174.8 7 22.09.2024
8.0.0-preview.2.23128.3 4 22.09.2024
8.0.0-preview.1.23110.8 4 22.09.2024
7.0.0 5 09.04.2024
7.0.0-rc.2.22472.3 4 22.09.2024
7.0.0-rc.1.22426.10 6 22.09.2024
7.0.0-preview.7.22375.6 4 22.09.2024
7.0.0-preview.6.22324.4 4 22.09.2024
7.0.0-preview.5.22301.12 5 22.09.2024
7.0.0-preview.4.22229.4 3 22.09.2024
7.0.0-preview.3.22175.4 5 22.09.2024
7.0.0-preview.2.22152.2 7 22.09.2024
7.0.0-preview.1.22076.8 6 22.09.2024
6.0.0 5 18.02.2024
6.0.0-rc.2.21480.5 5 22.09.2024
6.0.0-rc.1.21451.13 7 22.09.2024
6.0.0-preview.7.21377.19 4 22.09.2024
6.0.0-preview.6.21352.12 4 22.09.2024
6.0.0-preview.5.21301.5 4 29.10.2024
6.0.0-preview.4.21253.7 6 22.09.2024
6.0.0-preview.3.21201.4 4 22.09.2024
6.0.0-preview.2.21154.6 4 22.09.2024
6.0.0-preview.1.21102.12 6 22.09.2024
5.0.1 6 22.09.2024
5.0.0 6 22.09.2024
5.0.0-rc.2.20475.5 6 22.09.2024
5.0.0-rc.1.20451.14 5 22.09.2024
5.0.0-preview.8.20407.11 4 22.09.2024
5.0.0-preview.7.20364.11 4 22.09.2024
5.0.0-preview.6.20305.6 4 22.09.2024
5.0.0-preview.5.20278.1 6 22.09.2024
5.0.0-preview.4.20251.6 3 22.09.2024
5.0.0-preview.3.20214.6 5 22.09.2024
5.0.0-preview.2.20160.6 5 22.09.2024
5.0.0-preview.1.20120.5 5 22.09.2024
1.4.1 6 22.09.2024
1.4.0 7 22.09.2024
1.4.0-preview3.19551.4 4 22.09.2024
1.4.0-preview2.19523.17 4 22.09.2024
1.4.0-preview1.19504.10 6 22.09.2024
1.3.0 4 29.10.2024
1.3.0-rc1.19456.4 4 22.09.2024
1.3.0-preview9.19421.4 5 22.09.2024
1.3.0-preview9.19416.11 6 22.09.2024
1.3.0-preview8.19405.3 6 22.09.2024
1.3.0-preview7.19362.9 6 22.09.2024
1.3.0-preview6.19303.8 2 29.10.2024
1.3.0-preview6.19264.9 5 22.09.2024
1.3.0-preview5.19224.8 5 22.09.2024
1.3.0-preview4.19212.13 5 23.10.2024
1.3.0-preview3.19128.7 4 23.10.2024
1.3.0-preview.19073.11 5 22.09.2024
1.3.0-preview.18571.3 6 22.09.2024
1.2.0 4 22.09.2024
1.2.0-rc1 4 22.09.2024
1.2.0-preview2-26406-04 2 29.10.2024
1.2.0-preview1-26216-02 4 22.09.2024
1.1.0 4 22.09.2024
1.1.0-preview2-25405-01 6 22.09.2024
1.1.0-preview1-25305-02 6 22.09.2024
1.0.31 7 28.02.2024
1.0.31-preview1-24530-04 5 22.09.2024