System.Composition.TypedParts
10.0.0-preview.4.25255.103
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
This is a prerelease version of System.Composition.TypedParts.
dotnet add package System.Composition.TypedParts --version 10.0.0-preview.4.25255.103
NuGet\Install-Package System.Composition.TypedParts -Version 10.0.0-preview.4.25255.103
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="System.Composition.TypedParts" Version="10.0.0-preview.4.25255.103" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="System.Composition.TypedParts" Version="10.0.0-preview.4.25255.103" />
<PackageReference Include="System.Composition.TypedParts" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add System.Composition.TypedParts --version 10.0.0-preview.4.25255.103
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: System.Composition.TypedParts, 10.0.0-preview.4.25255.103"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=System.Composition.TypedParts&version=10.0.0-preview.4.25255.103&prerelease
#tool nuget:?package=System.Composition.TypedParts&version=10.0.0-preview.4.25255.103&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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
Related Packages
- System.Composition
- System.Composition.AttributedModel
- System.Composition.Convention
- System.Composition.Hosting
- System.Composition.Runtime
Feedback & Contributing
System.Composition.TypedParts is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- System.Composition.AttributedModel (>= 10.0.0-preview.4.25255.103)
- System.Composition.Hosting (>= 10.0.0-preview.4.25255.103)
- System.Composition.Runtime (>= 10.0.0-preview.4.25255.103)
-
.NETStandard 2.0
- System.Composition.AttributedModel (>= 10.0.0-preview.4.25255.103)
- System.Composition.Hosting (>= 10.0.0-preview.4.25255.103)
- System.Composition.Runtime (>= 10.0.0-preview.4.25255.103)
-
net10.0
- System.Composition.AttributedModel (>= 10.0.0-preview.4.25255.103)
- System.Composition.Hosting (>= 10.0.0-preview.4.25255.103)
- System.Composition.Runtime (>= 10.0.0-preview.4.25255.103)
-
net8.0
- System.Composition.AttributedModel (>= 10.0.0-preview.4.25255.103)
- System.Composition.Hosting (>= 10.0.0-preview.4.25255.103)
- System.Composition.Runtime (>= 10.0.0-preview.4.25255.103)
-
net9.0
- System.Composition.AttributedModel (>= 10.0.0-preview.4.25255.103)
- System.Composition.Hosting (>= 10.0.0-preview.4.25255.103)
- System.Composition.Runtime (>= 10.0.0-preview.4.25255.103)
GitHub repositories (23)
Showing the top 20 popular GitHub repositories that depend on System.Composition.TypedParts:
Repository | Stars |
---|---|
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
|
|
neuecc/Utf8Json
Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).
|
|
security-code-scan/security-code-scan
Vulnerability Patterns Detector for C# and VB.NET
|
|
icsharpcode/RefactoringEssentials
Refactoring Essentials for Visual Studio
|
|
chummer5a/chummer5a
Character generator for Shadowrun 5th edition
|
|
sharpenrocks/Sharpen
Visual Studio extension that intelligently introduces new C# features into your existing codebase
|
|
sonatype-nexus-community/DevAudit
Open-source, cross-platform, multi-purpose security auditing tool
|
|
dotnet/platform-compat
Roslyn analyzer that finds usages of APIs that will throw PlatformNotSupportedException on certain platforms.
|
|
godotengine/godot-csharp-visualstudio
Godot C# extension for Visual Studio
|
|
oleg-shilo/cs-script.npp
CS-Script (C# Intellisense) plugin for Notepad++ (x86/x64)
|
|
curiosity-ai/h5
🚀 The next generation C# to JavaScript compiler
|
|
PeterWaher/IoTGateway
New project
|
|
monroe31s/Nullpoint-Stealer
Nullpoint Stealer Designed To Steal Everything, And Send To Nullpoint Panel.
|
|
loamen/Kalman.Studio
Kalman.Studio代码生成器是一款基于T4模板引擎的代码生成器和开发辅助工具。可以根据数据库元数据架构信息来生成代码,还可以解析PowerDesigner物理模型文件,根据PDM模型对象来生成代码等。
|
|
ylatuya/XAMLator
|
|
rexcardan/Evil-DICOM
A C# DICOM Library
|
|
mavaddat/wasp
Windows Automation Snapin for PowerShell
|
|
geaz/sharpDox
A c# documentation tool (Discontinued)
|
|
szehetner/InliningAnalyzer
Inlining Analyzer is a Visual Studio Extension that shows in the source code if a method call will be inlined by the JIT compiler.
|
|
realvizu/QuickDiagram
Code visualization tool for C# to quickly explore, navigate and document source code structure and relationships. Integrates into Visual Studio.
|
Version | Downloads | Last updated |
---|---|---|
10.0.0-preview.4.25255.103 | 0 | 5/12/2025 |
1.3.0-preview.19073.11 | 2 | 1/28/2019 |
1.3.0-preview.18571.3 | 1 | 11/30/2018 |