System.Reflection.AmbiguousMatchException Class

public sealed class AmbiguousMatchException : SystemException

Base Types

Object
  Exception
    SystemException
      AmbiguousMatchException

Assembly

mscorlib

Library

Reflection

Summary

Represents the error that occurs when binding to a method or retrieving custom attributes results in more than one item matching the specified criteria.

Description

AmbiguousMatchException is thrown when a search that is intended to return no more than one match, detects multiple matching items. For example, this exception is thrown when the System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo,System.Type) methods (which return a single custom attribute), find multiple occurrences of the attribute.

See Also

System.Reflection Namespace

Members

AmbiguousMatchException Constructors

AmbiguousMatchException() Constructor
AmbiguousMatchException(System.String) Constructor
AmbiguousMatchException(System.String, System.Exception) Constructor


AmbiguousMatchException() Constructor

public AmbiguousMatchException();

Summary

Constructs and initializes a new instance of the AmbiguousMatchException class.

Description

This constructor initializes the System.Reflection.AmbiguousMatchException.Message property of the new instance to a system-supplied message that describes the error, such as "Ambiguous match found." This message takes into account the current system culture.

The System.Reflection.AmbiguousMatchException.InnerException property is initialized to null .

See Also

System.Reflection.AmbiguousMatchException Class, System.Reflection Namespace

AmbiguousMatchException(System.String) Constructor

public AmbiguousMatchException(string message);

Summary

Constructs and initializes a new instance of the AmbiguousMatchException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Description

This constructor initializes the System.Reflection.AmbiguousMatchException.Message property of the new instance using message. If message is null , the System.Reflection.AmbiguousMatchException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.

The System.Reflection.AmbiguousMatchException.InnerException property is initialized to null .

See Also

System.Reflection.AmbiguousMatchException Class, System.Reflection Namespace

AmbiguousMatchException(System.String, System.Exception) Constructor

public AmbiguousMatchException(string message, Exception inner);

Summary

Constructs and initializes a new instance of the AmbiguousMatchException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
inner
An instance of Exception that is the cause of the current Exception. If inner is non-null, then the current Exception was raised in a catch block handling inner .

Description

This constructor initializes the System.Reflection.AmbiguousMatchException.Message property of the new instance using message, and the System.Reflection.AmbiguousMatchException.InnerException property using inner. If message is null , the System.Reflection.AmbiguousMatchException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.

[Note: For information on inner exceptions, see System.Exception.InnerException.]

See Also

System.Reflection.AmbiguousMatchException Class, System.Reflection Namespace