Home All Groups Group Topic Archive Search About

"ambiguous" problem with VB.NET 2005

Author
13 Mar 2006 2:06 PM
Denis Samoilov
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)

Author
13 Mar 2006 8:57 PM
José_Manuel_Agüero
Hello, Denis:

Have you tried to unambiguate from the Global namespace?:
dim x as global.your_application's_namespace.n.c.enum1

Regards.


Show quoteHide quote
"Denis Samoilov" <DenisSamoi***@discussions.microsoft.com> escribió en el mensaje news:CD649718-98CE-4400-8EF5-EB28143F89CF@microsoft.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)
Author
15 Mar 2006 1:46 PM
Denis Samoilov
Thank you but this did not help
--
Denis Samoilov
Project Manager for PixTools team(ISIS Scanning and Image Manipulation)


Show quoteHide quote
"José Manuel Agüero" wrote:

> Hello, Denis:
>
> Have you tried to unambiguate from the Global namespace?:
> dim x as global.your_application's_namespace.n.c.enum1
>
> Regards.
>
>
> "Denis Samoilov" <DenisSamoi***@discussions.microsoft.com> escribió en el mensaje news:CD649718-98CE-4400-8EF5-EB28143F89CF@microsoft.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)
>
Author
15 Mar 2006 3:39 PM
José_Manuel_Agüero
Hello Denis,

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

dim obj as new N.C
'You may need to set the adecuate BindingFlags.
result = GetType(N.C).InvokeMember("Enum1", Reflection.BindingFlags.GetProperty, Nothing, obj, Nothing)



See also the PropertyInfo class.

Regards.


Show quoteHide quote
"Denis Samoilov" <DenisSamoi***@discussions.microsoft.com> escribió en el mensaje news:51AA6783-DCA8-429C-9042-8F98CEB188F7@microsoft.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_application's_namespace.n.c.enum1
| >
| > Regards.
| >
| >
| > "Denis Samoilov" <DenisSamoi***@discussions.microsoft.com> escribió en el mensaje news:CD649718-98CE-4400-8EF5-EB28143F89CF@microsoft.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)
Author
14 Mar 2006 3:44 AM
Michael D. Ober
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.

Show quoteHide quote
"Denis Samoilov" <DenisSamoi***@discussions.microsoft.com> wrote in message
news:CD649718-98CE-4400-8EF5-EB28143F89CF@microsoft.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)
>
Author
14 Mar 2006 3:45 AM
Michael D. Ober
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.

Show quoteHide quote
"Denis Samoilov" <DenisSamoi***@discussions.microsoft.com> wrote in message
news:CD649718-98CE-4400-8EF5-EB28143F89CF@microsoft.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)
>
Author
15 Mar 2006 1:45 PM
Denis Samoilov
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)


Show quoteHide quote
"Michael D. Ober" wrote:

> 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" <DenisSamoi***@discussions.microsoft.com> wrote in message
> news:CD649718-98CE-4400-8EF5-EB28143F89CF@microsoft.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)
> >
>
>
>
>
Author
14 Mar 2006 6:45 AM
Cor Ligthert [MVP]
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