public sealed class AmbiguousMatchException : SystemException
Object
Exception
SystemException
AmbiguousMatchException
mscorlib
Reflection
Represents the error that occurs when binding to a method or retrieving custom attributes results in more than one item matching the specified criteria.
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.
System.Reflection Namespace
AmbiguousMatchException Constructors
AmbiguousMatchException() Constructor
AmbiguousMatchException(System.String) Constructor
AmbiguousMatchException(System.String, System.Exception) Constructor
public AmbiguousMatchException();
Constructs and initializes a new instance of the AmbiguousMatchException class.
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
.
System.Reflection.AmbiguousMatchException Class, System.Reflection Namespace
public AmbiguousMatchException(string message);
Constructs and initializes a new instance of the AmbiguousMatchException class.
- 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.
This constructor initializes the System.Reflection.AmbiguousMatchException.Message property of the new instance using message. If message isnull
, 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
.
System.Reflection.AmbiguousMatchException Class, System.Reflection Namespace
public AmbiguousMatchException(string message, Exception inner);
Constructs and initializes a new instance of the AmbiguousMatchException class.
- 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 .
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 isnull
, 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.]
System.Reflection.AmbiguousMatchException Class, System.Reflection Namespace