Initializer for Couchbase.Lite.Database threw an exception in window 10 system

Hi,

We are facing some strange issues when we install our desktop app which is used couchbase .net lite 2.7.1.

This happens only in few systems not every system. Any help would be grateful for us.

Attached screenshots.

The details of the exception in the first screenshot don’t match the second. The most common cause of the 2nd exception is not having the Visual Studio 2015 C++ runtime installed on the machine though.

Do you mean Visual Studio 2015 C++ runtime in client system i mean wherever we installed our exe that system shoulde have Visual Studio 2015 c++ runtime?

Or

System where we generate a exe for customers to use our Desktop exe?

Please clarify to us. Thanks in advance.

Yes in other words the library is dependent on the C++ runtime to run. The exception message should be telling you about this but the message is not visible in the OS error dialogs.

Error:System.TypeInitializationException: The type initializer for ‘Couchbase.Lite.DI.Service’ threw an exception. —> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Couchbase.Lite.DI.Service.AutoRegister(Assembly assembly)
at Couchbase.Lite.DI.Service…cctor()
— End of inner exception stack trace —
at Couchbase.Lite.DI.Service.GetRequiredInstanceT
at Couchbase.Lite.DatabaseConfiguration…ctor()

My issue was if I run with a higher version of Newtonsoft.Json (v12).
Couchbase doesn’t like it. I had to roll back to v11 of Newtonsoft.
Unfortunately, there are other libraries that I’m using that require Newtonsoft.JSON v12.

But these types of errors are typically from linking the wrong dependencies and/or versions.