"ambiguous" problem with VB.NET 2005

G

Guest

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

Guest

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" <[email protected]> escribió en el mensaje | 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)
 
M

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

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

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
 
G

Guest

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 said:
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.
 
G

Guest

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.


"Denis Samoilov" <[email protected]> escribió en el mensaje | 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" <[email protected]> escribió en el mensaje | > | 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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top