Comments (10)
I managed to work around the error by:
- Creating a class that implements IRuntimePlatform
using Couchbase.Lite.DI;
internal class RuntimePlatform : IRuntimePlatform
{
public string OSDescription
{
get
{
return "Desktop";
}
}
public string HardwareName
{
get
{
return "NET 6";
}
}
}
Then before calling CBLite in my code, I register the class:
using Couchbase.Lite.DI;
if (!RegisteredRuntimePlatform)
{
Service.Register<IRuntimePlatform>(new RuntimePlatform());
RegisteredRuntimePlatform = true;
}
It's very inelegant but it avoids the error
from couchbase-lite-net.
Also having the same issue, workaround provided fixes issue.
from couchbase-lite-net.
It's interesting that this is the particular error that happens, and sorry that I didn't notice this ticket. However .NET 6 is still, as of yet, unsupported. 3.1 will be the first release to support it.
from couchbase-lite-net.
That being said I tried this with 3.0.8
using Couchbase.Lite;
var dbconfig = new DatabaseConfiguration()
{
Directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MyApp")
};
using var db = new Database("foo", dbconfig);
Console.WriteLine(db.Path);
I didn't see any errors like this. Can you confirm the reproduction steps?
from couchbase-lite-net.
I should of clarified that I'm actually on .net Framework 4.7.2. The problem only happens in version 3.0.0+, previous versions do not have this problem.
We are calling the constructor like this
using var db = new Database("pathHere");
I will see if I can create a reproduction repo.
from couchbase-lite-net.
I tried just now with .net 4.7.2 and 3.0.8, and I do not see the issue. Unrelated, but "pathHere" seems suspicious to me. That should be the database name, not a path.
from couchbase-lite-net.
Just for sanity sake, how are you observing this error? I believe internally this exception is thrown by SimpleInjector but then caught and handled so it doesn't actually affect the program flow. If you are just hitting it with a debugger set to halt on all exceptions it may trick you into thinking there is actually an issue where there is not. IRuntimePlatform
is not a required interface. Couchbase Lite will try to instantiate it, but if it does not exist then it will fall back to some .NET runtime defaults.
See the following:
couchbase-lite-net/src/Couchbase.Lite.Shared/API/DI/Service.cs
Lines 194 to 201 in 1dd997e
from couchbase-lite-net.
I think you might be onto something. I have another problem that is crashing our app when we move to 3x that is unrelated to this. I had my debugger set to recording non-user code exceptions and I think what I was seeing was the second problem silently killing the app after I continued through this exception, so I associated this exception as my app killer.
Since I turned off non-user code checks, I only get the unrelated error. Let me keep poking at this and I will get back to you.
from couchbase-lite-net.
So you are correct about the code above doing as it intended. My unrelated issue was solved by correctly calling the Database
constructor as you mentioned was suspicious. Seems that at some point the old way I was calling that constructor was deprecated. My code now does this.
database = new Database("nameHere", new DatabaseConfiguration
{
Directory = config.Paths.DatabasePath
});
from couchbase-lite-net.
Glad to hear that. I am going to close this issue as I think the original poster probably had the same misdiagnosed issue.
from couchbase-lite-net.
Related Issues (20)
- Memory leak when calling MutableArrayObject.AddBlob HOT 2
- LiteCore.dll not found for WinUI3/Project Reunion app (.NET 5) HOT 5
- Broke links HOT 2
- Couchbase.Lite.Enterprise 2.8.6 NuGet Package still referencing SimpleInjector 4.0.12 HOT 3
- Couchbase.Litee fails to load in .net framework due to missing dependency with Microsoft.Bcl.AsyncInterfaces. HOT 1
- Alias seems to break query HOT 6
- WinUI3/Windows App SDK Custom Library issue: Could not copy the file "../.nuget/packages/../lib/net5.0-windows10.0.19041/../x64/LiteCore.dll" HOT 5
- Couchbase randomly crashing during tests HOT 7
- `TypeInitializationException` when Couchbase.Lite.Support.NetDesktop.dll is less two directories deep HOT 4
- Mutable document is not accepting Decimal values HOT 3
- Typo in nuspec HOT 1
- Update Newtonsoft.Json to 13.0.1 (or newer) HOT 4
- Support for .NET 6.0/7.0 HOT 3
- ETA on MAUI version? HOT 2
- [MAUI] [iOS] dotnet maui iOS support nuget reference error HOT 9
- Mac M1 - ARM - LibLiteCore not found HOT 2
- SQLite error bind on a busy prepared statement HOT 11
- Couchbase Lite support for .NET 6.0/7.0 HOT 2
- .Net Maui Deployment to iPhone HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from couchbase-lite-net.