Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-1048

.NET Hello world example does not work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 2.2.4
    • 2.2.2
    • docs
    • None
    • VS 2013
      Windows 7

    Description

      Marking at this as blocker because it is extremely frustrating that a new user cannot simple copy, paste and run the hello world example.

      using Couchbase.Core;
      using Couchbase.Core.Buckets;
       
      internal class Program
      {
          private static readonly Cluster Cluster = new Cluster();
       
          private static void Main(string[] args)
          {
              using (var bucket = Cluster.OpenBucket())
              {
                  var document = new Document<dynamic>
                  {
                      Id = "Hello",
                      Content = new
                      {
                          name = "Couchbase"
                      }
                  };
       
                  var upsert = bucket.Upsert(document);
                  if (upsert.Success)
                  {
                      var get = bucket.GetDocument<dynamic>(document.Id);
                      document = get.Document;
                      var msg = string.Format("{0} {1}!", document.Id, document.Content.name);
                      Console.WriteLine(msg);
                  }
                  Console.Read();
              }
          }
      }
      

      Error message when you try and build:

      Error	1	The type or namespace name 'Cluster' could not be found (are you missing a using directive or an assembly reference?)	c:\users\dave\documents\visual studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs	12	29	ConsoleApplication1
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            marija Marija Jovanovic (Inactive)
            pvarley Patrick Varley (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty