System.DirectoryEntry Unknown error (0×80005000)
I have recently encountered this really unhelpful error message in VB.Net whilst trying to code a connection to an LDAP server. After much head banging I found the solution! It’s all down to the path you supply to the constructor: Old Connection (doesn’t work):
Using dir As New DirectoryEntry(ldap://yourserver:port) ' Your Code End UsingNew Connection (does work):
Using dir As New DirectoryEntry(LDAP://yourserver:port) ' Your Code End UsingSpot the difference? That’s right! the protocol part (LDAP) is case sensitive. Changing to uppercase works like a charm. Update: I have posted an article and sample code on working with LDAP here.
Technorati Tags: vb.net, directoryentry, unknown error, ldap