[Mono-devel-list] Error 49 when calling System.DirectoryServices.DirectorySearcher.FindAll()

STEPHEN W. COREY - 5535 swc at wardandsmith.com
Tue Jul 26 14:47:46 EDT 2005


I've got a C# console app that searches through MS Active Directory. The
code works correctly in Windows. When running the same exe through mono
(latest version) on a Red Hat 9 box, I get an exception, and the
"Exception.Message" returns "49". That's all. No description or
anything. Here's the code:

String LDAPPath = "LDAP://NBDC01/ou=accounts,dc=master,dc=ws,dc=law";
DirectoryEntry lRoot = new DirectoryEntry(LDAPPath, "myusername",
DirectorySearcher lSearcher = new DirectorySearcher(lRoot);
SearchResultCollection lResults = null;
lResults = lSearcher.FindAll();

An exception is raised on the last line (FindAll()). The Red Hat 9 box
has Samba configured, and can communicate with the LDAP server via
hostname or IP address. How can I find out what an Error 49 is, or
better yet, how to fix this? Thanks!

IT Engineer	Phone: (252) 672-5535
Fax: (252) 672-5503
1001 College Court
PO Box 867
New Bern, NC 28563-0867

If you have received this confidential message in error, please destroy
it and any attachments without reading, printing, copying or forwarding
it. Please let us know of the error immediately so that we can prevent
it from happening again. You may reply directly to the sender of this
message. Thank you.

Neither the name of Ward and Smith, P.A. or its representative, nor
transmission of this email from Ward and Smith, P.A., shall be
considered an electronic signature unless specifically stated otherwise
in this email by a licensed attorney employed by Ward and Smith, P.A.

More information about the Mono-devel-list mailing list