LiteCore DllNotFoundException

@borrrden
That was useful information. Thank you.

I had assumed my build was 64 bit. I created a small command line test app with Couchbase Lite. It failed.
I changed the project options to force 64bit for Platform Target (rather than “any”), That worked!

However, the NUnit apps are not so easy. I can select 64 bit build (NUnit projects build to libraries).
But the error is still there. I can run the NUnit tests on the command line:

  • install
    nuget install NUnit.ConsoleRunner

  • run:
    mono ~/.nuget/packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe bin/Debug/CoreTest.dll

This works (well… the DLLNotFound exception goes away - many tests still fail because of the large scale changes required for 1.x → 2.x, but that was expected).

I have been experimenting with trying to modify how VS runs the unit tests but to no avail so far.
A workaround that works for me is to switch to NUnitLite. This means changing the unit test project from building a library (for NUnit) to building an App, where the first line is:

    public static int Main(string[] args)
    {
        return new AutoRun().Execute(args);
    }

This works fine. There are undoubtedly better ways to do this - if anyone has read this far and knows how to better control NUnit execution on VS Mac, I’m all ears. (Note: I have played with setting up .runsettings files, and with using the NUnit Adapter. Neither worked).