Reputation: 21
I am trying to load spatialite to sqlite connection (in memory db) and it is failing with strange error without any message: Microsoft.Data.Sqlite.SqliteException: 'SQLite Error 1: ''.'
I isolated the problem to this short console app example:
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore.Infrastructure;
var connection = new SqliteConnection("DataSource=:memory:");
connection.Open();
connection.EnableExtensions();
SpatialiteLoader.Load(connection);
Console.ReadKey();
Project file looks like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.2" />
</ItemGroup>
</Project>
Downgrade of packages did not help. I tried the workaround mentioned here but I am not able to get it work.
Upvotes: 1
Views: 206