views:

82

answers:

2

A client of ours reported that when trying to use our .NET .DLL in VB.NET they receive the error:

error BC31429: 'OurClass' is ambiguous because multiple kinds of members with this name exist in namespace 'our.company.nspace'

I've also been able to reproduce the error with a dummy project containing the single line of

Dim x as our.company.nspace.OurClass

Normally this is because there are several types with names differing only in case. But in this case there is no such ambiguity. OurClass is a unique name not only in the specific namespace but in the whole assembly and any other assemblies referenced by the project. Reflector also shows this. There are also no class members with the same name, also verified by Reflector.

Also a weird thing is that the error wasn't there immediately after I created the dummy project, and then it suddenly appeared and now it doens't go away anymore. In fact I didn't even change anything between the two recompiles from which the first one worked, and the second didn't.

So... what gives?

(Note: the .DLL uses and references vjslib (J#), if that is of any relevance)

A: 

Have you tried using the Global. prefix? e.g.

Dim x as Global.our.company.nspace.OurClass

See http://msdn.microsoft.com/en-us/library/k701czy1(VS.90).aspx

Quango