Inner exception returns when trying connect with Couchbase server using C#

时间:2015-11-12 11:26:01

标签: c# .net couchbase nosql

Error occured when System is connecting to the Couchbase server using Couchbase.netClient. It returns error as below

InnerException: Couchbase.Configuration.ConfigException
       HResult=-2146233088
       Message= is this a Memcached bucket?
       Source=Couchbase.NetClient
       StackTrace:
            at Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.GetConfig(String bucketName, String password)
            at Couchbase.Core.ClusterController.CreateBucket(String bucketName, String password)

In couchbase, bucket type is Memcached. However it returns Error like "is this a Memcached bucket?". below shows App.config file and code to get clear image for this issue.

App.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <sectionGroup name="couchbaseClients">
      <section name="couchbase"
               type="Couchbase.Configuration.Client.Providers.CouchbaseClientSection, Couchbase.NetClient"/>
    </sectionGroup>
  </configSections>
  <couchbaseClients>
    <couchbase useSsl="false">
      <servers>
        <add uri="http://127.0.0.1:8091/pools"></add>
      </servers>
      <buckets>
        <add name="testing" useSsl="false" password="12345">
          <connectionPool name="custom" maxSize="10" minSize="5" sendTimeout="12000"></connectionPool>
        </add>
      </buckets>
    </couchbase>
  </couchbaseClients>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
  </startup>
</configuration>

C# code

using (var cluster = new Cluster("couchbaseClients/couchbase"))
            {
                using (var bucket = cluster.OpenBucket("testing", "12345"))
                {
                    //use the bucket here
                }
            }

1 个答案:

答案 0 :(得分:1)

这是一个版本问题,当Couchbase dll更新到最新版本时,它工作正常