VS 2013 & .net 3.5

I used Package Manager to add CouchbaseNetClient.1.3.7 to a .net framework 3.5 vb.net project.

I can Import Couchbase and use the namespace in code.

But once I compile/build my project I get the following error and Couchbase is no longer available in code.

Namespace or type specified in the Imports 'Couchbase' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

1 Answer

« Back to question.

harold -

I tried to replicate this and could not. I used took the following steps:

  1. I created a VB.NET console app using VS2012 and set the target framework to 3.5
  2. I then used Nuget to install the CouchbaseNetClient package (1.3.7)
  3. I added the following code:
    Imports Couchbase
     
    Module Module1
     
        Sub Main()
            Dim client = New CouchbaseClient()
            Console.Write("Instantiated client!")
            Console.Read()
        End Sub
     
    End Module
  4. Created an App.Config file with the following:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase" />
      </configSections>
      <couchbase>
        <servers bucket="default" bucketPassword="" username="Administrator" password="password" observeTimeout="00:01:00">
          <add uri="http://localhost:8091/pools" />
        </servers>
      </couchbase>
        <startup> 
     
        <supportedRuntime version="v2.0.50727" /></startup>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>

After that, built and run the project and it outputs "Instantiated client!" to stdout. Try the steps I outlined above and see what happens; it should work as expected.

-Jeff