"ambiguous" problem with VB.NET 2005

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Denis Samoilov

    "ambiguous" problem with VB.NET 2005

    We have a namespace N which includes enumeration ENUM1 and a class C with
    property C.Enum1, e.g.
    namespace N
    {
    public enum ENUM1{};
    public class C {
    public ENUM1 Enum1
    {
    get{}
    set{}
    }
    }
    }

    When we trying to use both N.ENUM1 and N.C.Enum1 from VB.NET 2005 we get the
    following error
    'ENUM1' is ambiguous because multiple kinds of members with this name exist
    in class 'N.C'

    With VB.NET 2003 all works fine.
    --
    Denis Samoilov
    Project Manager for PixTools team(ISIS Scanning and Image Manipulation)
  • José Manuel Agüero

    #2
    Re: "ambiguous " problem with VB.NET 2005

    Hello, Denis:

    Have you tried to unambiguate from the Global namespace?:
    dim x as global.your_app lication's_name space.n.c.enum1

    Regards.


    "Denis Samoilov" <DenisSamoilov@ discussions.mic rosoft.com> escribió en el mensaje news:CD649718-98CE-4400-8EF5-EB28143F89CF@mi crosoft.com...
    | We have a namespace N which includes enumeration ENUM1 and a class C with
    | property C.Enum1, e.g.
    | namespace N
    | {
    | public enum ENUM1{};
    | public class C {
    | public ENUM1 Enum1
    | {
    | get{}
    | set{}
    | }
    | }
    | }
    |
    | When we trying to use both N.ENUM1 and N.C.Enum1 from VB.NET 2005 we get the
    | following error
    | 'ENUM1' is ambiguous because multiple kinds of members with this name exist
    | in class 'N.C'
    |
    | With VB.NET 2003 all works fine.
    | --
    | Denis Samoilov
    | Project Manager for PixTools team(ISIS Scanning and Image Manipulation)

    Comment

    • Michael D. Ober

      #3
      Re: &quot;ambiguous &quot; problem with VB.NET 2005

      VB 2005 is case insensitve. In otherwords, ENUM1 and Enum1 are the same
      identifer in VB 2005. This was also the case in VB 6 and earlier and I
      suspect, but don't know for sure that it was true in VB 7.x (2002 & 2003) as
      well.

      Mike Ober.

      "Denis Samoilov" <DenisSamoilov@ discussions.mic rosoft.com> wrote in message
      news:CD649718-98CE-4400-8EF5-EB28143F89CF@mi crosoft.com...[color=blue]
      > We have a namespace N which includes enumeration ENUM1 and a class C with
      > property C.Enum1, e.g.
      > namespace N
      > {
      > public enum ENUM1{};
      > public class C {
      > public ENUM1 Enum1
      > {
      > get{}
      > set{}
      > }
      > }
      > }
      >
      > When we trying to use both N.ENUM1 and N.C.Enum1 from VB.NET 2005 we get[/color]
      the[color=blue]
      > following error
      > 'ENUM1' is ambiguous because multiple kinds of members with this name[/color]
      exist[color=blue]
      > in class 'N.C'
      >
      > With VB.NET 2003 all works fine.
      > --
      > Denis Samoilov
      > Project Manager for PixTools team(ISIS Scanning and Image Manipulation)
      >[/color]



      Comment

      • Michael D. Ober

        #4
        Re: &quot;ambiguous &quot; problem with VB.NET 2005

        One other thing - are you sure your VS 2003 was in VB 2003 and not VC# 2003.
        The sytax you gave below looks more like C than Basic. In C/C#, ENUM1 and
        Enum1 are different identifiers.

        Mike Ober.

        "Denis Samoilov" <DenisSamoilov@ discussions.mic rosoft.com> wrote in message
        news:CD649718-98CE-4400-8EF5-EB28143F89CF@mi crosoft.com...[color=blue]
        > We have a namespace N which includes enumeration ENUM1 and a class C with
        > property C.Enum1, e.g.
        > namespace N
        > {
        > public enum ENUM1{};
        > public class C {
        > public ENUM1 Enum1
        > {
        > get{}
        > set{}
        > }
        > }
        > }
        >
        > When we trying to use both N.ENUM1 and N.C.Enum1 from VB.NET 2005 we get[/color]
        the[color=blue]
        > following error
        > 'ENUM1' is ambiguous because multiple kinds of members with this name[/color]
        exist[color=blue]
        > in class 'N.C'
        >
        > With VB.NET 2003 all works fine.
        > --
        > Denis Samoilov
        > Project Manager for PixTools team(ISIS Scanning and Image Manipulation)
        >[/color]



        Comment

        • Cor Ligthert [MVP]

          #5
          Re: &quot;ambiguous &quot; problem with VB.NET 2005

          Denis,

          It is anoying, it is not only with your classes it is even with standard Net
          classes as by instance Forms.Dialog

          I cannot help you, however maybe good to know.

          Cor


          Comment

          • Denis Samoilov

            #6
            Re: &quot;ambiguous &quot; problem with VB.NET 2005

            We write SDK. So our code is on C# but our clients can use C#, VB.NET or
            other .net-language.

            This problem does not relate to case setivity because these two different
            identificators:
            N.ENUM1
            &
            N.C.Enum1

            --
            Denis Samoilov
            Project Manager for PixTools team(ISIS Scanning and Image Manipulation)


            "Michael D. Ober" wrote:
            [color=blue]
            > One other thing - are you sure your VS 2003 was in VB 2003 and not VC# 2003.
            > The sytax you gave below looks more like C than Basic. In C/C#, ENUM1 and
            > Enum1 are different identifiers.
            >
            > Mike Ober.
            >
            > "Denis Samoilov" <DenisSamoilov@ discussions.mic rosoft.com> wrote in message
            > news:CD649718-98CE-4400-8EF5-EB28143F89CF@mi crosoft.com...[color=green]
            > > We have a namespace N which includes enumeration ENUM1 and a class C with
            > > property C.Enum1, e.g.
            > > namespace N
            > > {
            > > public enum ENUM1{};
            > > public class C {
            > > public ENUM1 Enum1
            > > {
            > > get{}
            > > set{}
            > > }
            > > }
            > > }
            > >
            > > When we trying to use both N.ENUM1 and N.C.Enum1 from VB.NET 2005 we get[/color]
            > the[color=green]
            > > following error
            > > 'ENUM1' is ambiguous because multiple kinds of members with this name[/color]
            > exist[color=green]
            > > in class 'N.C'
            > >
            > > With VB.NET 2003 all works fine.
            > > --
            > > Denis Samoilov
            > > Project Manager for PixTools team(ISIS Scanning and Image Manipulation)
            > >[/color]
            >
            >
            >
            >[/color]

            Comment

            • Denis Samoilov

              #7
              Re: &quot;ambiguous &quot; problem with VB.NET 2005

              Thank you but this did not help
              --
              Denis Samoilov
              Project Manager for PixTools team(ISIS Scanning and Image Manipulation)


              "José Manuel Agüero" wrote:
              [color=blue]
              > Hello, Denis:
              >
              > Have you tried to unambiguate from the Global namespace?:
              > dim x as global.your_app lication's_name space.n.c.enum1
              >
              > Regards.
              >
              >
              > "Denis Samoilov" <DenisSamoilov@ discussions.mic rosoft.com> escribió en el mensaje news:CD649718-98CE-4400-8EF5-EB28143F89CF@mi crosoft.com...
              > | We have a namespace N which includes enumeration ENUM1 and a class C with
              > | property C.Enum1, e.g.
              > | namespace N
              > | {
              > | public enum ENUM1{};
              > | public class C {
              > | public ENUM1 Enum1
              > | {
              > | get{}
              > | set{}
              > | }
              > | }
              > | }
              > |
              > | When we trying to use both N.ENUM1 and N.C.Enum1 from VB.NET 2005 we get the
              > | following error
              > | 'ENUM1' is ambiguous because multiple kinds of members with this name exist
              > | in class 'N.C'
              > |
              > | With VB.NET 2003 all works fine.
              > | --
              > | Denis Samoilov
              > | Project Manager for PixTools team(ISIS Scanning and Image Manipulation)
              >[/color]

              Comment

              • José Manuel Agüero

                #8
                Re: &quot;ambiguous &quot; problem with VB.NET 2005

                Hello Denis,

                Maybe you'll have to use reflection to access the members.
                Use, for example, type.invokememb er to access the property:

                dim obj as new N.C
                'You may need to set the adecuate BindingFlags.
                result = GetType(N.C).In vokeMember("Enu m1", Reflection.Bind ingFlags.GetPro perty, Nothing, obj, Nothing)



                See also the PropertyInfo class.

                Regards.


                "Denis Samoilov" <DenisSamoilov@ discussions.mic rosoft.com> escribió en el mensaje news:51AA6783-DCA8-429C-9042-8F98CEB188F7@mi crosoft.com...
                | Thank you but this did not help
                | --
                | Denis Samoilov
                | Project Manager for PixTools team(ISIS Scanning and Image Manipulation)
                |
                |
                | "José Manuel Agüero" wrote:
                |
                | > Hello, Denis:
                | >
                | > Have you tried to unambiguate from the Global namespace?:
                | > dim x as global.your_app lication's_name space.n.c.enum1
                | >
                | > Regards.
                | >
                | >
                | > "Denis Samoilov" <DenisSamoilov@ discussions.mic rosoft.com> escribió en el mensaje news:CD649718-98CE-4400-8EF5-EB28143F89CF@mi crosoft.com...
                | > | We have a namespace N which includes enumeration ENUM1 and a class C with
                | > | property C.Enum1, e.g.
                | > | namespace N
                | > | {
                | > | public enum ENUM1{};
                | > | public class C {
                | > | public ENUM1 Enum1
                | > | {
                | > | get{}
                | > | set{}
                | > | }
                | > | }
                | > | }
                | > |
                | > | When we trying to use both N.ENUM1 and N.C.Enum1 from VB.NET 2005 we get the
                | > | following error
                | > | 'ENUM1' is ambiguous because multiple kinds of members with this name exist
                | > | in class 'N.C'
                | > |
                | > | With VB.NET 2003 all works fine.
                | > | --
                | > | Denis Samoilov
                | > | Project Manager for PixTools team(ISIS Scanning and Image Manipulation)

                Comment

                Working...