I’m using the CouchBase.NetClient 2.1 and I can create a Cluster Manager to list all the buckets; however, as soon as I try to retrieve a specific object by the key I get an error the reads, “Operation is not valid due to the current state of the object.”.
I’m also a bit confused as the previous versions (1.x), I provided the Administrator username and password in the web.config, but there doesn’t seem to be a place for that in the new version. Additionally, there is no password on each Memcached bucket, but they’re on dedicated ports. For simplicity sake, right now I’m just trying to access one bucket: global.
I’m running Version: 3.0.1 Community Edition (build-1444).
Here’s what the web.config looks like:
<couchbaseClients>
<couchbase>
<servers>
<add uri="http://servername:8091/pools" />
</servers>
<buckets>
<add name="global" password="" useSsl="false" />
</buckets>
</couchbase>
</couchbaseClients>
So, doing the following lists all the buckets as expected:
using (var cluster = new Cluster("couchbaseClients/couchbase"))
{
var cm = cluster.CreateManager("Administrator", "password");
return cm.ListBuckets();
}
But, retrieving a key doesn’t work:
using (var cluster = new Cluster("couchbaseClients/couchbase"))
{
var cacheBucket = cluster.OpenBucket("global");
return cacheBucket.Get<dynamic>(cacheKey);
}
I feel like I’m missing something really simple. Any idea what I’m getting wrong here?