Table of Contents

Class CompositionFailedException

Namespace
Microsoft.VisualStudio.Composition
Assembly
Microsoft.VisualStudio.Composition.dll

An exception thrown when failures occur during composition.

[Serializable]
public class CompositionFailedException : Exception, ISerializable
Inheritance
CompositionFailedException
Implements
Inherited Members

Constructors

CompositionFailedException()

Initializes a new instance of the CompositionFailedException class.

public CompositionFailedException()

CompositionFailedException(SerializationInfo, StreamingContext)

Initializes a new instance of the CompositionFailedException class.

protected CompositionFailedException(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext

CompositionFailedException(string?)

Initializes a new instance of the CompositionFailedException class.

public CompositionFailedException(string? message)

Parameters

message string

CompositionFailedException(string?, IImmutableStack<IReadOnlyCollection<ComposedPartDiagnostic>>)

Initializes a new instance of the CompositionFailedException class.

public CompositionFailedException(string? message, IImmutableStack<IReadOnlyCollection<ComposedPartDiagnostic>> errors)

Parameters

message string
errors IImmutableStack<IReadOnlyCollection<ComposedPartDiagnostic>>

The errors that occurred during composition. The errors are collected as a stack. The topmost stack element represents the first level of errors detected. As errors are detected and parts removed to achieve a 'stable composition', each cycle of removing parts and detecting additional errors gets a deeper element in the stack. Therefore the 'root cause' of all failures is generally found in the topmost stack element.

CompositionFailedException(string?, Exception?)

Initializes a new instance of the CompositionFailedException class.

public CompositionFailedException(string? message, Exception? innerException)

Parameters

message string
innerException Exception

Properties

Errors

Gets the compositional errors that occurred.

public IImmutableStack<IReadOnlyCollection<ComposedPartDiagnostic>>? Errors { get; }

Property Value

IImmutableStack<IReadOnlyCollection<ComposedPartDiagnostic>>

Remarks

This collection is not serialized via the ISerializable interface. Refer to ErrorsAsString for a serialized form of these errors.

ErrorsAsString

Gets a string representation of the compositional errors that are described in Errors (or were, before serialization dropped that data).

public string? ErrorsAsString { get; }

Property Value

string

Methods

GetObjectData(SerializationInfo, StreamingContext)

public override void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext