LDAP Connection to Internal LDAP Server Issues

Apr 25, 2013 at 3:54 PM
I am trying to use the LinqToLdap.Samples on my company internal LDAP server.

I am configuring the sample as follows:

Ldap Server Address: ldap.company.com
        new LdapConfiguration()
            .MaxPageSizeIs(1000)
            //we only need to map Group this way since it doesn't use attributes
            .AddMapping(new AutoClassMap<Group>())
            .AddMapping(new AttributeClassMap<User>())
            .ConfigurePooledFactory("ldap.company.com")
            .UsePort(389)
            .AuthenticateBy(AuthType.Negotiate)
            .AuthenticateAs(CredentialCache.DefaultNetworkCredentials);
When I test this code an exception is thrown indicating that my configuration settings are null.

Throws an exception: DirectoryContext.cs Line 90
    public DirectoryContext()
    {
        if (LdapConfiguration.Configuration == null || LdapConfiguration.Configuration.ConnectionFactory == null)
            throw new MappingException("A static configuration and connection factory must be provided. See LdapConfiguration.");
Both LdapConfiguration.Configuration and LdapConfiguration.Configuration.ConnectionFactory are Null

What am I missing?

Thank you
Coordinator
Apr 28, 2013 at 5:23 AM
Add .UseStaticStorage() to the configuration chain right after you instantiate LdapConfiguration.