System.Composition.TypedParts 10.0.0

About

System.Composition.TypedParts is part of the Managed Extensibility Framework (MEF) 2.0, a composition library for .NET that enables dependency injection through attributes or conventions.

Provides ContainerConfiguration and some extension methods for the Managed Extensibility Framework (MEF).

Key Features

  • Provides container configuration.

How to Use

Register parts from an entire assembly.

using System.Composition;
using System.Composition.Hosting;
using System.Reflection;

// Register all parts from the current assembly
var configuration = new ContainerConfiguration()
    .WithAssembly(Assembly.GetExecutingAssembly());

using CompositionHost container = configuration.CreateContainer();

var handlers = container.GetExports<IHandler>();
foreach (var handler in handlers)
{
    handler.Handle();
}
// HandlerA is handling.
// HandlerB is handling.

public interface IHandler
{
    void Handle();
}

[Export(typeof(IHandler))]
public class HandlerA : IHandler
{
    public void Handle() => Console.WriteLine("HandlerA is handling.");
}

[Export(typeof(IHandler))]
public class HandlerB : IHandler
{
    public void Handle() => Console.WriteLine("HandlerB is handling.");
}

Main Types

The main types provided by this library are:

  • System.Composition.Hosting.ContainerConfiguration
  • System.Composition.CompositionContextExtensions

Additional Documentation

Feedback & Contributing

System.Composition.TypedParts 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.TypedParts.

Packages Downloads
Microsoft.VisualStudio.Imaging
A member of the Visual Studio SDK
72
Microsoft.VisualStudio.Shell.15.0
A member of the Visual Studio SDK
67
Microsoft.VisualStudio.Shell.15.0
A member of the Visual Studio SDK
68
Microsoft.VisualStudio.Shell.15.0
A member of the Visual Studio SDK
69
Microsoft.VisualStudio.Utilities
A member of the Visual Studio SDK
69
Microsoft.VisualStudio.Utilities
A member of the Visual Studio SDK
73
Microsoft.VisualStudio.Utilities
A member of the Visual Studio SDK
79
Microsoft.VisualStudio.Utilities
A member of the Visual Studio SDK
80
Microsoft.VisualStudio.Utilities
A member of the Visual Studio SDK
82
Microsoft.VisualStudio.Utilities
A member of the Visual Studio SDK
96
System.Composition
Provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
74
System.Composition
Provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web.
85
System.Composition
This package provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web. Commonly Used Types: System.Composition.ExportAttribute System.Composition.ImportAttribute System.Composition.Convention.ConventionBuilder System.Composition.Hosting.CompositionHost System.Composition.CompositionContext System.Composition.CompositionContextExtensions
70
System.Composition
This package provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web. Commonly Used Types: System.Composition.ExportAttribute System.Composition.ImportAttribute System.Composition.Convention.ConventionBuilder System.Composition.Hosting.CompositionHost System.Composition.CompositionContext System.Composition.CompositionContextExtensions
71
System.Composition
This package provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web. Commonly Used Types: System.Composition.ExportAttribute System.Composition.ImportAttribute System.Composition.Convention.ConventionBuilder System.Composition.Hosting.CompositionHost System.Composition.CompositionContext System.Composition.CompositionContextExtensions
86
System.Composition
This package provides a version of the Managed Extensibility Framework (MEF) that is lightweight and specifically optimized for high throughput scenarios, such as the web. Commonly Used Types: System.Composition.ExportAttribute System.Composition.ImportAttribute System.Composition.Convention.ConventionBuilder System.Composition.Hosting.CompositionHost System.Composition.CompositionContext System.Composition.CompositionContextExtensions
91
System.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. Commonly Used Types: System.Composition.ExportAttribute System.Composition.ImportAttribute System.Composition.Convention.ConventionBuilder System.Composition.Hosting.CompositionHost System.Composition.CompositionContext System.Composition.CompositionContextExtensions
76
System.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. Commonly Used Types: System.Composition.ExportAttribute System.Composition.ImportAttribute System.Composition.Convention.ConventionBuilder System.Composition.Hosting.CompositionHost System.Composition.CompositionContext System.Composition.CompositionContextExtensions
100
System.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. Commonly Used Types: System.Composition.ExportAttribute System.Composition.ImportAttribute System.Composition.Convention.ConventionBuilder System.Composition.Hosting.CompositionHost System.Composition.CompositionContext System.Composition.CompositionContextExtensions When using NuGet 3.x this package requires at least version 3.4.
88
System.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. Commonly Used Types: System.Composition.ExportAttribute System.Composition.ImportAttribute System.Composition.Convention.ConventionBuilder System.Composition.Hosting.CompositionHost System.Composition.CompositionContext System.Composition.CompositionContextExtensions When using NuGet 3.x this package requires at least version 3.4.
124

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

Version Downloads Last updated
10.0.0 51 11/14/2025
10.0.0-rc.2.25502.107 41 10/19/2025
10.0.0-rc.1.25451.107 48 09/14/2025
10.0.0-preview.7.25380.108 48 08/14/2025
10.0.0-preview.6.25358.103 50 07/17/2025
10.0.0-preview.5.25277.114 56 06/08/2025
10.0.0-preview.4.25258.110 58 05/16/2025
10.0.0-preview.3.25171.5 53 04/27/2025
10.0.0-preview.2.25163.2 61 03/30/2025
10.0.0-preview.1.25080.5 47 03/07/2025
9.0.11 36 11/15/2025
9.0.10 32 10/18/2025
9.0.9 38 09/13/2025
9.0.8 40 08/11/2025
9.0.7 38 07/11/2025
9.0.6 38 06/12/2025
9.0.5 80 05/17/2025
9.0.4 54 04/28/2025
9.0.3 53 03/13/2025
9.0.2 52 02/22/2025
9.0.1 48 01/27/2025
9.0.0 68 12/15/2024
9.0.0-rc.2.24473.5 53 12/28/2024
9.0.0-rc.1.24431.7 86 12/10/2024
9.0.0-preview.7.24405.7 59 12/28/2024
9.0.0-preview.6.24327.7 68 12/06/2024
9.0.0-preview.5.24306.7 57 12/04/2024
9.0.0-preview.4.24266.19 90 05/28/2024
9.0.0-preview.3.24172.9 58 06/03/2024
9.0.0-preview.2.24128.5 51 12/06/2024
9.0.0-preview.1.24080.9 68 05/28/2024
8.0.0 67 05/27/2024
8.0.0-rc.2.23479.6 69 05/28/2024
8.0.0-rc.1.23419.4 86 05/28/2024
8.0.0-preview.7.23375.6 57 05/28/2024
8.0.0-preview.6.23329.7 55 05/28/2024
8.0.0-preview.5.23280.8 60 06/14/2023
8.0.0-preview.4.23259.5 54 05/28/2024
8.0.0-preview.3.23174.8 55 05/28/2024
8.0.0-preview.2.23128.3 58 05/28/2024
8.0.0-preview.1.23110.8 69 05/28/2024
7.0.0 101 12/18/2023
7.0.0-rc.2.22472.3 51 05/28/2024
7.0.0-rc.1.22426.10 55 05/28/2024
7.0.0-preview.7.22375.6 60 05/28/2024
7.0.0-preview.6.22324.4 62 05/28/2024
7.0.0-preview.5.22301.12 63 05/28/2024
7.0.0-preview.4.22229.4 58 05/28/2024
7.0.0-preview.3.22175.4 51 05/28/2024
7.0.0-preview.2.22152.2 66 05/28/2024
7.0.0-preview.1.22076.8 64 05/28/2024
6.0.2-mauipre.1.22102.15 56 05/28/2024
6.0.2-mauipre.1.22054.8 66 05/28/2024
6.0.0 66 02/01/2023
6.0.0-rc.2.21480.5 59 05/28/2024
6.0.0-rc.1.21451.13 64 05/28/2024
6.0.0-preview.7.21377.19 58 05/28/2024
6.0.0-preview.6.21352.12 77 05/28/2024
6.0.0-preview.5.21301.5 59 05/28/2024
6.0.0-preview.4.21253.7 58 05/28/2024
6.0.0-preview.3.21201.4 48 05/28/2024
6.0.0-preview.2.21154.6 55 05/28/2024
6.0.0-preview.1.21102.12 112 05/28/2024
5.0.1 59 05/27/2024
5.0.0 59 05/27/2024
5.0.0-rc.2.20475.5 112 05/28/2024
5.0.0-rc.1.20451.14 52 05/28/2024
5.0.0-preview.8.20407.11 64 05/28/2024
5.0.0-preview.7.20364.11 53 05/28/2024
5.0.0-preview.6.20305.6 84 05/28/2024
5.0.0-preview.5.20278.1 61 05/28/2024
5.0.0-preview.4.20251.6 57 05/28/2024
5.0.0-preview.3.20214.6 57 05/28/2024
5.0.0-preview.2.20160.6 57 05/28/2024
5.0.0-preview.1.20120.5 76 05/28/2024
1.4.1 59 05/27/2024
1.4.0 61 05/27/2024
1.4.0-preview3.19551.4 52 05/28/2024
1.4.0-preview2.19523.17 62 05/28/2024
1.4.0-preview1.19504.10 51 05/28/2024
1.3.0 83 05/27/2024
1.3.0-rc1.19456.4 62 05/28/2024
1.3.0-preview9.19421.4 61 05/28/2024
1.3.0-preview9.19416.11 57 05/19/2024
1.3.0-preview8.19405.3 99 05/28/2024
1.3.0-preview7.19362.9 47 05/28/2024
1.3.0-preview6.19303.8 64 05/28/2024
1.3.0-preview6.19264.9 66 05/28/2024
1.3.0-preview5.19224.8 59 05/28/2024
1.3.0-preview4.19212.13 58 05/28/2024
1.3.0-preview3.19128.7 55 05/28/2024
1.3.0-preview.19073.11 68 05/28/2024
1.3.0-preview.18571.3 54 05/28/2024
1.2.0 54 05/27/2024
1.2.0-rc1 64 05/28/2024
1.2.0-preview2-26406-04 53 05/28/2024
1.2.0-preview1-26216-02 61 05/28/2024
1.1.0 57 05/27/2024
1.1.0-preview2-25405-01 53 05/28/2024
1.1.0-preview1-25305-02 52 05/28/2024
1.0.31 123 05/05/2022
1.0.31-preview1-24530-04 62 05/28/2024