Ambiguous match found.

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

Hi

I have just created a new ASP .net web project and when i run the project I
receieve this error:

System.Reflection.AmbiguousMatchException: Ambiguous match found.

Any help would be much appreciated

Thanks
B
 
Hi Ben,

Suppose you have 2 namespaces, foo and bar.

Each namespace has a class with the same name: foo.ClassA and bar.ClassA

You've imported the namespaces for your convenience, so you don't have to
use the namespace when you type your code:

Imports foo
Imports bar

Now, you type the following code:

Public Snafu AS ClassA = new ClassA()

Which class is instantiated? foo.ClassA or bar.ClassA?

The name "ClassA" is ambiguous because without the namespace, the compiler
can't tell which class in which namespace you mean.

Ambiguity has a certain quality to it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
Thanks Kevin

My own fault for not checking the Web Form Designer Generated Code.

Many thanks

B
 
Back
Top