I am running EF Core on Windows and Linux and have same issue on both.
public string DbPath { get; }
string DbPath = $ "{Environment.GetFolderPath(Environment.SpecialFolder.Personal)}{Path.DirectorySeparatorChar}smart_contracts.db";
This prints the path on Linux and on Windows 10. When I try to run Add-Migration
and Update-Database
I get the SQLite error
Error 1: 'no such table: __EFMigrationsHistory'. error.
Code:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite($"Data Source={DbPath}");
}
If I change it to Data Source=smart_contracts.db
, it works perfectly on both platforms.
Can anyone help me get a path into the data source string?