views:

19

answers:

1

When I try to compile my VB.NET web project, I get an error that reads:

[PropertyName] is not a member of '[Namespace.Class]' 

The class referenced is part of a dll that the project references. The property definitely exists in the referenced class, and its access modifier is Public. What's more, if I update the reference, or just remove it and add it back, the error goes away: the intellisense shows my property -- all is fine.. that is until I try to compile again. Then the error returns. I've even restarted Visual Studio to no avail. What is going on?

[UPDATE] After Will's comment, I've changed the namespace to something I am absolutely sure is unique. Now, I am getting more compiler errors of the same genre. The compiler is not recognizing some of the overloads although they are right there in intellisense. Weird!

Here's the code where I got the error before:

Dim gis = New MapQuestGeocoder
Dim r = gis.GetResult(address)
originCoord = r.Coordinate

The Coordinate property was not recognized. Now, the error is "Overload resolution failed..." and is raised in a different class, on the second line below:

Dim gis = New MapQuestDirections()
Dim route = gis.GetResult(originAddress, address)

Both MapQuestGeocoder and MapQuestDirections reside in the same dll, same namespace: Kosh.Geo

A: 

Ok, so I figured out that the second error was happening because the bin directory retained both the old assembly and the new one, which I had named differently to match the new namespace. I am concluding that the old dll was there even after I had removed the reference because another dll in my project depends on this very same Geo assembly. I am thinking that this may have precipitated the original error as well because the Geo assemblies got out of sync.

Antony Highsky