CompositionHost.TryGetExport(CompositionContract, Object) Method

Definition

Retrieves the specified export from the composition context.

C#
public override bool TryGetExport(System.Composition.Hosting.Core.CompositionContract contract, out object export);

Parameters

contract
CompositionContract

The export to retrieve.

export
Object

When this method returns, contains an instance of the export if available; otherwise, null.

Returns

true if the export was retrieved; otherwise, false.

Exceptions

There are too many exports.

Applies to

Product Versions
.NET Core 1.1, 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)