System.AccessViolationException during query.Execute() in NetDesktop

I am a new user of Couchbase Lite Net. Can anyone help with this? I am using the same example as in Getting Started guide and getting

‘System.AccessViolationException’ in Couchbase.Lite.Support.NetDesktop.dll in query.Execute()

I am using Nuget Package Version


That’s a hard one to diagnose but it sometimes happens if you use a query after disposing it or it’s database. Does that sound possible?

I am not disposing anything manually and code is pretty simple so I don’t think it is happening. But I am experiencing very weird behavior as App doesn’t crash every time. Sometime it gives right result, sometime empty results and sometime exception. Btw thanx for quick response.

I get this same exception when calling Contains on a MutableDictionaryObject.
I am basically using it as the “Source” for my properties, but when I am trying to use an instance from a query result, it ends throwing this excpetion.
maybe this is the reason why I am having this issue, but I also tried using the IDictionary<string,object> but, strange enough, what I did store as an int, becomes in there a long when I retrieve it back from the mobile db.
So two issues maybe to file:
1 - Contains on MutableDictionaryObject throws AccessViolationException
2 - stored int is returned from db as long

Thank you for your help and collaboration

#2 is not a problem and won’t be addressed. We don’t actually store 32-bit integers on disk, only 64-bit ones. That is the reason that we have the GetInt() method, which will still return the correct result. Don’t rely on the actual type of the object.

#1 If you have a repro snippet then file it as a GH issue and it will be addressed.