System.Composition.Hosting 9.0.0-rc.2.24473.5
About
System.Composition.Hosting
is part of the Managed Extensibility Framework (MEF) 2.0, a composition library for .NET that enables dependency injection through attributes or conventions.
This package provides core services for creating composition containers. It offers tools to configure and manage the composition of parts within your application, facilitating dependency injection and enabling modular architectures.
Key Features
- Create and manage composition containers for dynamic dependency injection.
How to Use
Create a composition host and compose parts.
using System.Composition;
using System.Composition.Hosting;
// Create a container configuration
var configuration = new ContainerConfiguration()
.WithPart<Service>();
// Create the composition host (container)
using CompositionHost container = configuration.CreateContainer();
// Get an instance of the service
var service = container.GetExport<IService>();
service.Run();
// Service is running!
public interface IService
{
void Run();
}
[Export(typeof(IService))]
public class Service : IService
{
public void Run() => Console.WriteLine("Service is running!");
}
Main Types
The main type provided by this library is:
System.Composition.CompositionHost
Additional Documentation
Related Packages
- System.Composition
- System.Composition.AttributedModel
- System.Composition.Convention
- System.Composition.Runtime
- System.Composition.TypedParts
Feedback & Contributing
System.Composition.Hosting 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.Hosting.
Packages | Downloads |
---|---|
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
|
116 |
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
|
37 |
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
|
38 |
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
|
122 |
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.
|
34 |
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.
|
36 |
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.
|
37 |
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.
|
53 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
|
34 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
|
35 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
|
36 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
|
103 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
|
127 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
00490982c7952e96a1089818467caa6fd07541b2
When using NuGet 3.x this package requires at least version 3.4.
|
34 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
029cf57733b7ec6c1dd8a13857e800b9a8d97192
When using NuGet 3.x this package requires at least version 3.4.
|
33 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
When using NuGet 3.x this package requires at least version 3.4.
|
35 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
When using NuGet 3.x this package requires at least version 3.4.
|
36 |
System.Composition.TypedParts
Provides some extension methods for the Managed Extensibility Framework.
Commonly Used Types:
System.Composition.CompositionContextExtensions
System.Composition.Hosting.ContainerConfiguration
When using NuGet 3.x this package requires at least version 3.4.
|
51 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- System.Composition.Runtime (>= 9.0.0-rc.2.24473.5)
.NET 8.0
- System.Composition.Runtime (>= 9.0.0-rc.2.24473.5)
.NET 9.0
- System.Composition.Runtime (>= 9.0.0-rc.2.24473.5)
.NET Standard 2.0
- System.Composition.Runtime (>= 9.0.0-rc.2.24473.5)