System.Composition 9.0.0

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/e482b6e281d7db727fcb086ebbfae44dcba82c6d.
39
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.
36
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.
86
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.
37
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/43b0b05cc4f492fd5de00f6f6717409091df8daa.
43
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.
37
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.
38
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.
37
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.
86
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.
80
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.
43
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.
39
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.
63
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.
56
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.
38
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/e873e69306527a0424e97af2985370556f474019
38
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.
36
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
40
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/ab56a4a6c32268d925014a3e45ddce61fba715cd
40
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/e68227ea677b76a3c603bd616f03ea6d952b2458.
39

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

Version Downloads Last updated
9.0.0 6 11/14/2024
9.0.0-rc.2.24473.5 6 10/22/2024
9.0.0-rc.1.24431.7 8 09/19/2024
9.0.0-preview.7.24405.7 12 08/18/2024
9.0.0-preview.6.24327.7 22 07/18/2024
9.0.0-preview.5.24306.7 30 07/18/2024
9.0.0-preview.4.24266.19 24 07/18/2024
9.0.0-preview.3.24172.9 30 07/18/2024
9.0.0-preview.2.24128.5 28 07/18/2024
9.0.0-preview.1.24080.9 33 07/18/2024
8.0.0 26 07/18/2024
8.0.0-rc.2.23479.6 24 07/18/2024
8.0.0-rc.1.23419.4 31 07/18/2024
8.0.0-preview.7.23375.6 23 07/18/2024
8.0.0-preview.6.23329.7 24 07/18/2024
8.0.0-preview.5.23280.8 27 07/18/2024
8.0.0-preview.4.23259.5 29 07/18/2024
8.0.0-preview.3.23174.8 25 07/18/2024
8.0.0-preview.2.23128.3 35 07/18/2024
8.0.0-preview.1.23110.8 32 07/18/2024
7.0.0 136 02/05/2024
7.0.0-rc.2.22472.3 28 07/18/2024
7.0.0-rc.1.22426.10 34 07/18/2024
7.0.0-preview.7.22375.6 31 07/18/2024
7.0.0-preview.6.22324.4 29 07/18/2024
7.0.0-preview.5.22301.12 30 07/18/2024
7.0.0-preview.4.22229.4 30 07/18/2024
7.0.0-preview.3.22175.4 40 07/18/2024
7.0.0-preview.2.22152.2 29 07/18/2024
7.0.0-preview.1.22076.8 35 07/18/2024
6.0.0 130 02/04/2024
6.0.0-rc.2.21480.5 27 07/18/2024
6.0.0-rc.1.21451.13 32 07/18/2024
6.0.0-preview.7.21377.19 41 07/18/2024
6.0.0-preview.6.21352.12 24 07/18/2024
6.0.0-preview.5.21301.5 29 07/18/2024
6.0.0-preview.4.21253.7 32 07/18/2024
6.0.0-preview.3.21201.4 28 07/18/2024
6.0.0-preview.2.21154.6 27 07/18/2024
6.0.0-preview.1.21102.12 30 07/18/2024
5.0.1 39 07/18/2024
5.0.0 35 07/18/2024
5.0.0-rc.2.20475.5 35 07/18/2024
5.0.0-rc.1.20451.14 35 07/18/2024
5.0.0-preview.8.20407.11 33 07/18/2024
5.0.0-preview.7.20364.11 31 07/18/2024
5.0.0-preview.6.20305.6 23 07/18/2024
5.0.0-preview.5.20278.1 26 07/18/2024
5.0.0-preview.4.20251.6 23 07/18/2024
5.0.0-preview.3.20214.6 27 07/18/2024
5.0.0-preview.2.20160.6 38 07/18/2024
5.0.0-preview.1.20120.5 28 07/18/2024
1.4.1 35 07/18/2024
1.4.0 29 07/18/2024
1.4.0-preview3.19551.4 27 07/18/2024
1.4.0-preview2.19523.17 31 07/18/2024
1.4.0-preview1.19504.10 38 07/18/2024
1.3.0 34 07/18/2024
1.3.0-rc1.19456.4 24 07/18/2024
1.3.0-preview9.19421.4 25 07/18/2024
1.3.0-preview9.19416.11 29 07/18/2024
1.3.0-preview8.19405.3 33 07/18/2024
1.3.0-preview7.19362.9 30 07/18/2024
1.3.0-preview6.19303.8 30 07/18/2024
1.3.0-preview6.19264.9 31 07/18/2024
1.3.0-preview5.19224.8 29 07/18/2024
1.3.0-preview4.19212.13 37 07/18/2024
1.3.0-preview3.19128.7 23 07/18/2024
1.3.0-preview.19073.11 35 07/18/2024
1.3.0-preview.18571.3 27 07/18/2024
1.2.0 30 07/18/2024
1.2.0-rc1 36 07/18/2024
1.2.0-preview2-26406-04 34 07/18/2024
1.2.0-preview1-26216-02 25 07/18/2024
1.1.0 31 07/18/2024
1.1.0-preview2-25405-01 26 07/18/2024
1.1.0-preview1-25305-02 32 07/18/2024
1.0.31 57 02/04/2024
1.0.31-preview1-24530-04 28 07/18/2024