For a .NET 4.8 app, exactly what nuget packages are required to add Sqlite support to a ThinkGeo WPF 13 app. A minimum sample project with the recommended Sqlite packages and versions would be appreciated.
Thanks!
For a .NET 4.8 app, exactly what nuget packages are required to add Sqlite support to a ThinkGeo WPF 13 app. A minimum sample project with the recommended Sqlite packages and versions would be appreciated.
Thanks!
There’s something wrong with SqliteFeatureLayer under .net framework 4.8, and we’re working on it. It works well with .net 6, you could try it if it’s an alternative for you.
Thanks,
Leo
This is an issue in the ThinkGeo Dependecy Microsoft.Data.Sqlite. Here is how to work it around in case anyone need it:
Copy the dlls (one for x86 and one for x64) from e_sqlite3.zip (1.6 MB) to the following folders respectively:
\bin\Debug\net48\runtimes\win-x86\native
and
\bin\Debug\net48\runtimes\win-x64\native
Ben
In case it’s helpful to anyone, this turns out to be a limitation of using the new NuGet package in an old-style project. After updating the project to SDK-style (introduced in Visual Studio 2019), everything works as expected. We mentioned this in the following post: SqlServerFeatureLayer issues - ThinkGeo UI for Desktop / WPF, and I’m copying the relevant part here for convenience:
You can think of it as a limitation of the .NET Framework runtime, that the newer Microsoft.Data.SqlClient package isn’t fully compatible with the legacy project system.
Reason:
The package includes several native DLLs that .NET Framework doesn’t correctly resolve under AnyCPU .
How to Fix:
.NET Framework 4.8 under AnyCPU ..NET 8 and .NET 4.8 . you can simply edit the .csproj to the following to make it net48 only<TargetFrameworks>net48</TargetFrameworks>
x64 or x86 — instead of AnyCPU .I’ve run into similar issues with other packages too. Realistically, we’ll probably need to migrate away from .NET Framework at some point in the future.