I was unable to connect from C# .net SDK 3.0.3 to Couch base server 6.5.1 community

I was trying access couch base server from asp.net C# console app but it is always throwing an exception.
Bucket with name travel-sample does not exist.
stack Tace : at Couchbase.Core.ClusterContext.d__51.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Couchbase.Cluster.<>c__DisplayClass25_0.<b__0>d.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask1.get_Result() at System.Runtime.CompilerServices.ValueTaskAwaiter1.GetResult()

Note : I was able to perform all crud operation in UI

Sample Code :

public static async Task ConnectCouchBase()
{
try
{
var cluster = await Cluster.ConnectAsync(“http://localhost:8091”, “****”, “*****”);
var bucket = await cluster.BucketAsync(“travel-sample”);
var collection = bucket.DefaultCollection();
var getResult = await collection.GetAsync(“airline_10”);

            cluster.Dispose();
        }
        catch(Exception ex)
        {
            Console.WriteLine(ex);
        }

Hi @SharathKumarKJ,

The error message indicates that the bucket “travel-sample” doesn’t exist. If you haven’t created/loaded travel-sample, the .NET SDK will not do that for you.

Also, this may not be related, but try couchbase://localhost instead of http://localhost:8091