BUILD couchbase.Lite.net

Hey,
I wanna build CB.Lite.Net Feature 2.0 (Net desktop and UWP support), But I fail at native library generation. Please full doc build instructions.
I think this screenshot would tell you what I did and what is the problem:

Generating the native libraries is not part of the .NET build process. That is a separate process you have to do first. It looks like you already succeeded at running CMake. The command for building for UWP is different than for desktop though. It is:

cmake -G "Visual Studio 14 2015 [arch]" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.14393.0" ..\.. [arch] can be Win64, or ARM, or blank for Win32. Run those builds in x86_store x64_store and ARM directories in the build_cmake directory to get the native libraries compiled.

Also, if you are not interested in Mac and Linux you can create empty files in place of libLiteCore.so and libLiteCore.dylib.

I got these after cmake, but again those errors in Visual Studio :frowning:

EDIT :
I’m building packaging x64
4 Errors in support.UWP that is shown above.
those two errors about libLiteCore.so and libLiteCore.dylib are fixed.

CMake is not the whole step. CMake just generates the projects. You then need to build them. Either via the LiteCore.sln solution, or by running cmake --build . --target LiteCore --config RelWithDebInfo

P.S. The packaging target needs to have all the DLLs built because it is meant for packaging. If you are just trying to reference locally you can get away with the Release or Debug target, but be warned that I haven’t found a way for Visual Studio to automatically copy the DLL content of a subproject so your top project will need to copy it again.

Could not build :frowning:
Tried from commandline too. No result

Don’t build ALL_BUILD. Build just the LiteCore subproject.

ERROR again :((

That doesn’t look related to LiteCore -> https://developercommunity.visualstudio.com/content/problem/54387/vcmetadll-not-found-after-latest-update.html

I really donno what to do:(

If you donno what to do, please send me those 4 files.

To tell the truth, I coded an object mapper for Couchbase.Lite.Net, But because I can not build the support pack, I can not test and pull request :(((

This one I can help out with. I usually build with Visual Studio 2015, so when I tried with Visual Studio 2017 I had the same problem. In the LiteCore root folder, edit the CMakeLists.txt file and find the places where it mentions “Visual Studio 14 2015” and change those to “Visual Studio 15 2017”.

Also, if you are just looking for precompiled LiteCore.dll files, you can unzip any nupkg file and they are inside there.

Can not find LiteCore.pdb in ngpkg

Churga Curga Churga !
Built !!

But I have no idea about how to build the UWP nuget package (The .net standard was really easy.):
.
I referenced to my project instead of adding nupkg, and I got this:

This “LiteCore” acts like a bad boy.

I think I warned you about this before but Visual Studio doesn’t like copying native DLLs from subprojects so even if you reference it, LiteCore.dll will end up not being copied. You need to add a (Content) reference to the actual LiteCore.dll from your top-level project. I don’t know why this is needed and it is annoying but it seems like a Visual Studio limitation. Make sure that you add the correct architecture (here is what I do for the unit tests).

And finally…
WORKING !!!
Thanks :wink: