-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlite3_open_v2 broken (Unity3D) #324
Comments
Apparently I forgot to add required libraries. As we are in the Unity world and cannot use tools like NuGet I have to add the libraries all by myself. So what I need to work with in Unity are:
... and native libraries depending on your platform from the Is there a better way to do this? |
v1 used to provide a better exception message:
|
@MeikelLP Have you seen NuGetForUnity? I'm not sure if it supports everything you need to install SQLitePCLRaw, but it's worth a shot. |
@bricelam Yes I've seen this but I prefer OpenUPM. But there is no package yet available. |
Today I noticed this error again. Not in Unity but rather in ASP.NET Core 3.1.3. public class Program
{
public static void Main(string[] args)
=> CreateHostBuilder(args).Build().Run();
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureServices(x => x.AddDbContext<NucleusDbContext>(options =>
{
var configuration = x.BuildServiceProvider().GetRequiredService<IConfiguration>();
options.UseSqlite(configuration.GetConnectionString("DefaultConnection"));
}));
}
} The problem is that I get the exact same error as I got before with Unity: PS F:\projekte\none\MyCoolProject\Backend\Core> dotnet ef database update --startup-project ..\Migrator\
Build started...
Build succeeded.
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 3.1.3 initialized 'NucleusDbContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: using lazy-loading proxies
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Data.Sqlite.SqliteConnection.Open()
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteDatabaseCreator.Exists()
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Object reference not set to an instance of an object. This can be easily fixed with adding the package reference to that migrator project as well: <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.3" /> |
I'm using
Microsoft.Data.Sqlite
to access a sqlite3 file from my Unity3D game.so I tried like:
and I get:
I tried this:
and get the same error.
Any reasons why that is not working? The db file is not broken. I can read & write to it via DataGrip.
The text was updated successfully, but these errors were encountered: