1

I'm trying to create CouchbaseClient instance but i'm getting this error:

The type initializer for 'Couchbase.CouchbaseClient' threw an exception

Everything has worked just fine before I put Couchbase dll in:

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Couchbase\v4.0_1.2.6.0__05e9c6b5a9ec94c2

And Enyim.Caching.dll in the old .NET 2.0 GAC.

Couchbase Console shows that the database is up and running.

Here is my app.config of the client tester:

<?xml version="1.0"?>
<configuration>

  <configSections>
    <section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
  </configSections>    

  <couchbase>
    <servers bucket="default" bucketPassword="private">
      <add uri="http://127.0.0.1:8091/pools/default"/>
    </servers>
  </couchbase>

  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

</configuration>

What can I do in order to make this thing work ?

Note that the inner Exception is:

"Could not load file or assembly 'Couchbase' or one of its dependencies. The system cannot find the file specified.":"Couchbase"

1 Answer 1

1

Solved it by changing the App.Config reference to Couchbase:

<configSections>    
  <section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase, Version=1.2.6.0, Culture=neutral, PublicKeyToken=05e9c6b5a9ec94c2"/>
</configSections>

I needed to reference the GAC

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.