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.ValueTaskAwaiter
1.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);
}