0

I am trying out Couchbase database, I've followed the tutorial here:

http://developer.couchbase.com/documentation/server/4.0/sdks/dotnet-2.2/hello-couchbase.html

I've installed the nugget from Package manager, and started to code. But as I am trying to call Cluster.OpenBucket function I am getting :

An unhandled exception of type 'System.AggregateException' occurred in Couchbase.NetClient.dll

"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

That's my code:

class DbMgr
{
    private static readonly Cluster Cluster = new Cluster();
    const string BUCKET_NAME = "This-Is-A-Bucket-Name";

    public void Init()
    {
        //This is where I get exception....
        using (var bucket = Cluster.OpenBucket(BUCKET_NAME, "")) 
        {
            var document = new Document<dynamic>
            {
                Id = "Hello",
                Content = new
                {
                    name = "Couchbase"
                }
            };
        }
    }
}

Any Ideas?

DaveR
  • 9,540
  • 3
  • 39
  • 58
Pavel Durov
  • 1,287
  • 2
  • 13
  • 28
  • 1
    Is the server installed on the same machine where you're running the code? Creating a new Cluster object without specifying a host means it will try to connect to localhost by default. – David Ostrovsky Nov 17 '15 at 14:36
  • I guess server wasn't on, although I thought it was... Anyway now when I launch the Couchbase server the posted code works. Thanks ! :) – Pavel Durov Nov 19 '15 at 07:26

0 Answers0