'<elementname>' is ambiguous because multiple kinds of members with this name exist in <type> '<typename>'
An expression accesses a programming element defined in a class, structure, module, or interface that contains more than one member with the same name.
The most likely cause of this error is case sensitivity. Visual Basic names are case-insensitive, which means you can capitalize them differently at different places in your code. For example, if you define a variable with the name XYZ
and later access it as xyz
, the compiler considers the two names to be equivalent.
However, other languages, such as C# and Visual C++, are case-sensitive. In such a language, XYZ
and xyz
are not considered to be the same name. Therefore, a class written in such a language could define a variable named XYZ
and a property named xyz
. The common language runtime (CLR) preserves case sensitivity in assemblies. However, if a Visual Basic application accesses an assembly with names XYZ
and xyz
, they appear as the same name.
Error ID: BC31429
To correct this error
If you have control over the source code of the defining type, consider renaming the members so that they differ by more than only casing. This might not be possible if the defining type has already been published and is being used by other applications.
If you cannot rename the members in the defining type, remove the cited programming element from your code. You cannot access an element that appears to Visual Basic to have multiple definitions.