Ambiguous match found.

Discussion in 'ASP .Net' started by Ben, Apr 27, 2005.

  1. Ben

    Ben Guest

    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
     
    Ben, Apr 27, 2005
    #1
    1. Advertising

  2. 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.

    "Ben" <> wrote in message
    news:...
    > 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
    >
     
    Kevin Spencer, Apr 27, 2005
    #2
    1. Advertising

  3. Ben, there are a few hits out there if you google on "asp.net ambiguous match".

    "Ben" wrote:

    > 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
    >
    >
    >
     
    =?Utf-8?B?QmlsbCBCb3Jn?=, Apr 27, 2005
    #3
  4. Ben

    Ben Guest

    Thanks Kevin

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

    Many thanks

    B

    "Kevin Spencer" <> wrote in message
    news:...
    > 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.
    >
    > "Ben" <> wrote in message
    > news:...
    >> 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
    >>

    >
    >
     
    Ben, Apr 28, 2005
    #4
  5. Ben

    bond007

    Joined:
    Mar 23, 2010
    Messages:
    1
    Hi Kevin,

    This is my frist blog on this site. What you saying is correct, but what I found is it occurs even if we declare Private variables with same name. Say for eg if I declare lstABC and if same name with upper case for dropdown LstABC.


    Thanks
    Vaibhav
     
    bond007, Mar 23, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Denon
    Replies:
    2
    Views:
    4,384
    Yuke Liew
    Jan 2, 2004
  2. =?Utf-8?B?QWxleGFuZHJl?=

    Error: Ambiguous match found.

    =?Utf-8?B?QWxleGFuZHJl?=, Apr 23, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    16,619
    OnPreInit
    Oct 1, 2009
  3. Francois
    Replies:
    3
    Views:
    668
    Hans Kesting
    May 22, 2007
  4. aparna

    Ambiguous match found

    aparna, Mar 25, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    429
    aparna
    Mar 26, 2008
  5. Craig Jewiss via .NET 247

    "Error Creating Control" - "Ambiguous match found"

    Craig Jewiss via .NET 247, Apr 26, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    235
    Craig Jewiss via .NET 247
    Apr 26, 2004
Loading...

Share This Page