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
Related Packages
- System.Composition.AttributedModel
- System.Composition.Convention
- System.Composition.Hosting
- System.Composition.Runtime
- System.Composition.TypedParts
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.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.
|
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/2242fa4fb945b97680bdd49eb5dd58285e4abb1c.
|
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/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/9d80dea7fe1b14043b9b2ac4d0b59ed26f508742.
|
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/b90347a69117be7181e2f03a991790634981eddb.
|
35 |
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.
|
34 |
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.
|
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/6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3.
|
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/ae1fff344d46976624e68ae17164e0607ab68b10.
|
26 |
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/231aeb8be8357239499d45c0574e5a9a8c9174f0.
|
25 |
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/7a63d79b60ffb33e919bee8056816f8f449d00ce.
|
25 |
Microsoft.CodeAnalysis
.NET Compiler Platform ("Roslyn").
This is the all-in-one package (a superset of all assemblies). You can install any of these sub-packages if you only want part of the functionality:
- "Microsoft.CodeAnalysis.CSharp.Workspaces" (C# compiler + services)
- "Microsoft.CodeAnalysis.VisualBasic.Workspaces" (VB compiler + services)
- "Microsoft.CodeAnalysis.Compilers" (both compilers)
- "Microsoft.CodeAnalysis.CSharp" (only the C# compiler)
- "Microsoft.CodeAnalysis.VisualBasic (only the VB compiler)
More details at https://aka.ms/roslyn-packages
This package was built from the source at https://github.com/dotnet/roslyn/commit/e68227ea677b76a3c603bd616f03ea6d952b2458.
|
25 |
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
|
23 |
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/069a85a786acae3be2c7b49e330b7f968a624c88.
|
22 |
Microsoft.CodeAnalysis
.NET Compiler Platform ("Roslyn").
This is the all-in-one package (a superset of all assemblies). You can install any of these sub-packages if you only want part of the functionality:
- "Microsoft.CodeAnalysis.CSharp.Workspaces" (C# compiler + services)
- "Microsoft.CodeAnalysis.VisualBasic.Workspaces" (VB compiler + services)
- "Microsoft.CodeAnalysis.Compilers" (both compilers)
- "Microsoft.CodeAnalysis.CSharp" (only the C# compiler)
- "Microsoft.CodeAnalysis.VisualBasic (only the VB compiler)
More details at https://aka.ms/roslyn-packages
This package was built from the source at https://github.com/dotnet/roslyn/commit/e482b6e281d7db727fcb086ebbfae44dcba82c6d.
|
22 |
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/75d31ee941ce4dbbe5752f4ac2d5c0583f388a27.
|
20 |
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/2fc92d84e746c3aab75f0930278ea6675cd5bb5c.
|
18 |
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/eb0a7ff1c241695e17b07b096593804fdd5cfcfd.
|
16 |
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.
|
15 |
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/416f7c5a54bcf5c34eaf69ffa04cf3f12435b153.
|
15 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- System.Composition.AttributedModel (>= 9.0.0)
- System.Composition.TypedParts (>= 9.0.0)
- System.Composition.Runtime (>= 9.0.0)
- System.Composition.Hosting (>= 9.0.0)
- System.Composition.Convention (>= 9.0.0)
.NET Standard 2.0
- System.Composition.TypedParts (>= 9.0.0)
- System.Composition.Runtime (>= 9.0.0)
- System.Composition.Hosting (>= 9.0.0)
- System.Composition.Convention (>= 9.0.0)
- System.Composition.AttributedModel (>= 9.0.0)
.NET 9.0
- System.Composition.TypedParts (>= 9.0.0)
- System.Composition.Runtime (>= 9.0.0)
- System.Composition.Hosting (>= 9.0.0)
- System.Composition.AttributedModel (>= 9.0.0)
- System.Composition.Convention (>= 9.0.0)
.NET 8.0
- System.Composition.Runtime (>= 9.0.0)
- System.Composition.Hosting (>= 9.0.0)
- System.Composition.Convention (>= 9.0.0)
- System.Composition.AttributedModel (>= 9.0.0)
- System.Composition.TypedParts (>= 9.0.0)