[Mono-devel-list] System.DirectoryServices exception when using OpenLDAP for Win32

Gomez Aragoneses, Andres agomez at wke.es
Wed Oct 6 09:18:16 EDT 2004


Hello. 

I am developing a web app to access to an LDAP server that I have installed
with OpenLDAP on a Win32 machine. I am running Mono 1.0.1 for Windows and as
I can see in the following URL, I can use System.DirectoryServices:

http://www.dotnet247.com/247reference/msgs/36/182188.aspx

But when I try to do the same, I get the following exception:

System.ArgumentNullException: Argument cannot be null.
in <0x00075> System.String:FormatHelper
(System.Text.StringBuilder,System.IFormatProvider,string,object[])
in <0x0003a> System.String:Format (System.IFormatProvider,string,object[])
in <0x0015d> Novell.Directory.Ldap.Utilclass.ResourcesHandler:getMessage
(string,object[],System.Globalization.CultureInfo)
in <0x00013> Novell.Directory.Ldap.Utilclass.ResourcesHandler:getMessage
(string,object[])
in <0x000b9> Novell.Directory.Ldap.LdapException:getExceptionString (string)
in <0x00013> Novell.Directory.Ldap.LdapException:ToString ()
in <0x001e3> System.Web.HttpException:GetDefaultErrorMessage ()
in <0x00044> System.Web.HttpException:GetHtmlErrorMessage ()
in <0x001cf> System.Web.HttpRuntime:FinishRequest
(System.Web.HttpContext,System.Exception)
in <0x000e9> System.Web.HttpRuntime:OnHandlerReady (System.IAsyncResult)
in <0x0005a> (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_IAsyncResult (System.IAsyncResult)
in <0x00058> System.Web.HttpAsyncResult:Complete
(bool,object,System.Exception)
in <0x0022a> StateMachine:ExecuteNext (System.Exception)
in <0x0004b> StateMachine:ExecuteNextAsync (System.Exception)
in <0x0001f> StateMachine:Start ()
in <0x00064>
System.Web.HttpApplication:System.Web.IHttpAsyncHandler.BeginProcessRequest
(System.Web.HttpContext,System.AsyncCallback,object)
in <0x002e9> System.Web.HttpRuntime:InternalExecuteRequest
(System.Web.HttpWorkerRequest)

Isn't this class fully implemented yet? Is this class compatible with
OpenLDAP (instead of Active Directory)? Which is the difference between
using this class and Novell.Directory.Ldap libraries?

I am not sure, but as I can see here
[http://www.go-mono.com/class-status-System.DirectoryServices.html] this
class is not fully implemented, but I also have found that the attribute
"System.DirectoryServices.DirectoryEntry.Properties", which is a collection,
is not present on the list! Why? (I thought that it should appear and point
to a "TODO" icon...).

My code:

  DirectoryEntry oDE = new DirectoryEntry("ldap://localhost/cn=Andres
Gomez,dc=wke,dc=es",
                                          "cn=Admin,dc=wke,dc=es",
"my_password",
                                          AuthenticationTypes.ServerBind);
  oDE.Properties["homePhone"].Add("91-3514304");
  oDE.CommitChanges();
  oDE.Close();

Thanks in advance,
	
	Andres Gomez



More information about the Mono-devel-list mailing list