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 Using

New Connection (does work):

Using dir As New DirectoryEntry(LDAP://yourserver:port)
	' Your Code
End Using

Spot 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: , , ,



3 Responses to “System.DirectoryEntry Unknown error (0×80005000)”

  1. Ben SWITZERLAND Windows XP Opera 9.25 Says:

    Hello Barry

    This helped me as lot. Thank you! I storm-clicked some banners for reward.

    Best regards.

  2. Paul UNITED STATES Windows 7 Internet Explorer 8.0 Says:

    Wow,
    That is annoying. Thanks for helping us noobs out.

  3. Nathan UNITED KINGDOM Windows Vista Google Chrome 4.0.266.0 Says:

    Hi.

    Thanks for the post, you’re Google’s top hit for “unknown error 80005000″! Quite an achievement…

    Just hit this error and spent a while trying to figure out the cause, you saved me a lot of head-keyboard induced pain.

    Followed Ben’s example and did a stack of banner-clicking for you.

Leave a Reply


foreandaft