2.0 DP3: You can't specify more than one bucket on xml configuration section


#1

It’s not possible to specify more than one bucket on the xml configuration file section. Only the last bucket specified will be added to the configuration. I can’t login to Jira so I post my fix here:

ClientConfiguration.cs
Problem Code:

    /// <summary>
    /// For synchronization with App.config or Web.configs.
    /// </summary>
    /// <param name="couchbaseClientSection"></param>
    internal ClientConfiguration(CouchbaseClientSection couchbaseClientSection)
    {
       ...
        foreach (var bucketElement in couchbaseClientSection.Buckets)
        {
            var bucket = (BucketElement) bucketElement;
             ...
            BucketConfigs = new Dictionary<string, BucketConfiguration> {{bucket.Name, bucketConfiguration}};
        }
    }

should read:

///


/// For synchronization with App.config or Web.configs.
///

///
internal ClientConfiguration(CouchbaseClientSection couchbaseClientSection)
{

BucketConfigs = new Dictionary<string, BucketConfiguration>();
foreach (var bucketElement in couchbaseClientSection.Buckets)
{

BucketConfigs.Add(bucket.Name, bucketConfiguration);
}
}

Otherwise BucketConfigs will always be overwritten with the last element found.


#2

Hi coboluxx -

I created a Jira ticket for this: http://www.couchbase.com/issues/browse/NCBC-713

If you think your fix is solid enough and feel like contributing, you can always create a pull request: https://github.com/couchbase/couchbase-net-client

Thank for bringing this to our attention!

Jeff