CBLite (db16) NetDesktop.Activate() Error on Windows 7

When calling NetDesktop.Activate() on a Windows 7 SP1 (+all latest important patches), with .NET Framework 4.7, Visual C++ 2015 Update 3 Redistributable, using CBLite 2.0 (db016) it fails:

The procedure entry point LoadPackagedLibrary could not be located in the dynamic link library KERNEL32.dll.

After which .NET Framework throws System.BadImageFormatException on LiteCore.dll.

Could not load LiteCore.dll! Nothing is going to work!.

I get this for any Project targetting .NET Framework 4.7 referencing NuGets for Couchbase.Lite and Couchbase.Lite.Support.NetDesktop v2.0.0-db016.

Afaik Windows 7 is supported in Couchbase Mobile 1.4 and I can’t find any documentation that it has been deprecated for 2.0?

Edit: 64 bit Windows 7. 64 bit project.

Sorry to hear about that! Our .NET engineer @borrrden is on vacation so you may not get an authoritative answer until sometime next week (I’m not sure how many days he’s taking off.)

I just checked our internal platform support matrix document, and it’s only showing Windows 10 as supported, not earlier versions … so I think that would explain your error. Can you update to Windows 10? (That’s about as far as I can help; I don’t know anything about .NET myself.)

I have a minute to pop in. That method is for Windows 8 and above and I thought I had loaded it dynamically based on the version of Windows that is running but I guess not. We don’t have any Windows 7 machines or VMs so I’ll have to see if I can make one when I return. In the meantime file an issue on the repo so I don’t forget about this. I don’t think we intend to only support Windows 10 and the document shows what we are testing on now. The runtime is refusing to load LiteCore into the process because it is using nonexistent methods. I will need to track down why that is happening in order to fix it.

1 Like

Thank you for popping in! I will file an issue for this on the repo.

I don’t mind very much that it’s not working at this moment, as we’re still in DB anyway, but it’s good to hear that Windows 7 is intended to be supported, as we need Win 7 support for our product.

The final decision about windows 7 has not been made yet. I think we have yet to try things out on there so it will be supported unless something comes along and railroads it off. The only thing I can think of for that would be if web sockets don’t work.

We have a requirement to use Couchbase Lite nuget package in Windows 7 systems as most of the end users are using Windows 7. Is Couchbase Lite 2.x.x still unsupported in Windows 7? Please advise

I get the below error when I try to run the application in Windows 7 while it is working perfect in Win 10
Could not load LiteCore.dll! Nothing is going to work!

A while ago I made it work with Windows 7, but since then we have moved away from supporting it because it is three years out of mainstream support with only 1 1/2 years until the end of support entirely. We don’t have the bandwidth to test on such a system, but if you can figure out the exact problem I might be able to figure out what’s wrong.

Thanks Jim for the quick response. When we invoke Couchbase.Lite.Support.NetDesktop.Activate() method, this gives us Could not load LiteCore.dll! Nothing is going to work! error message in Windows 7. Meanwhile it is working fine in Win 10. Can you please suggest how can we make it work in Win 7

Indeed you already said that, but things are not so simple. You will need to do some debugging to figure out why it says that. The most common case is that one of the dependencies is not available on the computer. Do you have Visual Studio 2015 installed? If not you will need to install the VS2015 C++ redistributable runtime for one thing. You can also use Dependency Walker to flush out any missing dependencies for LiteCore.dll. As for LiteCore.dll itself, it is inside of the nuget package.

2 Likes

Thank you so much Jim. The issue is resolved in Win 7 after I installed VS2015 C++ redistributable runtime in the system.

2 Likes