I’m trying upgrade from Couchbase 4.0 to 6.5 and using SDK 3.0.1. We are only using kv and stores data as byte. I want to change as little code as possible keeping my old contract intact.
I found out that I have to use a Transcoder and/or serializer, but when I want to use it Couchbase throws a NullReferenceException.
private async Task InitializeClusterAsync()
{
var options = new ClusterOptions()
{
KvTimeout = TimeSpan.FromSeconds(12),
ManagementTimeout = TimeSpan.FromSeconds(12),
EnableDnsSrvResolution = false,
};
options.WithConnectionString("couchbase://localhost")
.WithCredentials(username: Username, password: Password)
.WithSerializer(new DefaultSerializer())
.WithTranscoder(new LegacyTranscoder());
cluster = await Couchbase.Cluster.ConnectAsync(options);
}
at Couchbase.Core.ClusterContext.<BootstrapGlobalAsync>d__49.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Couchbase.Cluster.<Couchbase-Core-Bootstrapping-IBootstrappable-BootStrapAsync>d__42.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Couchbase.Cluster.<ConnectAsync>d__22.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Brunata.Ulfberht.TestAssisters.CouchbaseBucketHelper.<InitializeClusterAsync>d__22.MoveNext() in C:\Source\Repos\Ulfberht.RIS\Ulfberht\Testing\TestAssisters\CouchbaseBucketHelper.cs:line 161
.NET SDK 3.0.1
Couchbase Server CE 6.5.1