CompositionException Constructors

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Initializes a new instance of the CompositionException class.

Overloads

CompositionException()

Initializes a new instance of the CompositionException class.

CompositionException(IEnumerable<CompositionError>)

Initializes a new instance of the CompositionException class with the specified collection of composition errors.

CompositionException(String)

Initializes a new instance of the CompositionException class with the specified error message.

CompositionException(String, Exception)

Initializes a new instance of the CompositionException class with the specified error message and the exception that is the cause of this exception.

CompositionException()

Source:
CompositionException.cs
Source:
CompositionException.cs
Source:
CompositionException.cs

Initializes a new instance of the CompositionException class.

C#
public CompositionException();

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

CompositionException(IEnumerable<CompositionError>)

Source:
CompositionException.cs
Source:
CompositionException.cs
Source:
CompositionException.cs

Initializes a new instance of the CompositionException class with the specified collection of composition errors.

C#
public CompositionException(System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.CompositionError>? errors);
C#
public CompositionException(System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.CompositionError> errors);

Parameters

errors
IEnumerable<CompositionError>

A collection of CompositionError objects that represent problems during composition.

Exceptions

errors contains an element that is null.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

CompositionException(String)

Source:
CompositionException.cs
Source:
CompositionException.cs
Source:
CompositionException.cs

Initializes a new instance of the CompositionException class with the specified error message.

C#
public CompositionException(string? message);
C#
public CompositionException(string message);

Parameters

message
String

A message that describes the CompositionException or null to set the Message property to its default value.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

CompositionException(String, Exception)

Source:
CompositionException.cs
Source:
CompositionException.cs
Source:
CompositionException.cs

Initializes a new instance of the CompositionException class with the specified error message and the exception that is the cause of this exception.

C#
public CompositionException(string? message, Exception? innerException);
C#
public CompositionException(string message, Exception innerException);

Parameters

message
String

A message that describes the CompositionException or null to set the Message property to its default value.

innerException
Exception

The exception that is the underlying cause of the CompositionException or null to set the InnerException property to null.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)