Unable to activate Couchbase Lite on .Net Standard 2.0

Hello,

I am trying to incorporate Couchbase into one of my .Net Standard 2.0 librarys and am having an issue with running the platform activation code. As i am planning on this running inside netcore 2.0 i have added the Couchbase.Lite.Support.NetDesktop Nuget package in order to activate. However my build fails when trying to validate ‘Couchbase.Lite.Support.NetDesktop.Activate();’ saying that it cannot resolve the symbol.

What is wierd is that i can see the public static method from inside the object explorer, and i have no reference warnings on my Nuget import as described above.

Is couchbase lite not officially supported on Standard 2.0? Or is something else wrong here.

You must call activate at the APP project, not the library project. Activate has no context inside of a library project.

That makes some sense, i can understand why, just annoying that i cannot nest that call inside my library even if its called from an APP.

I managed to get it working anyway, thanks.

That’s a decent point and awkward for people deploying libraries based on Couchbase Lite that I hadn’t considered. I’ll have to think about that to see if there is a good solution. I tried once before to make the call automatic but that doesn’t work because the C# compiler will see no usage of the support assembly and remove it from the reference list at compile time. Perhaps this is the nail that will force me to abandon .NET Standard and begin using multitargeting…I don’t much look forward to that though for a number of reasons.