I'm trying to implement the code based on console application sample but in WPF and I get the following error:

I've added the migration and updated the database. This is how my DbContext looks like:
```c#
public class SettingsDbContext : DbContext
{
public DbSet
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite("Data Source=settings.db");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Client1Credentials>(c =>
{
c.HasNoKey();
c.Property(p => p.Username);
c.Property(p => p.Password);
});
modelBuilder.Entity<Client2Credentials>(c =>
{
c.HasNoKey();
c.Property(p => p.Username);
c.Property(p => p.Password);
});
}
}
Here is how my **Model** looks like:
```c#
public class UserSettings
{
public int Id { get; set; }
public bool RememberCredentials { get; set; }
[NotMapped]
public Client1Credentials Client1Credentials { get; set; }
[NotMapped]
public Client2Credentials Client2Credentials { get; set; }
}
Below you can see that the migration and database were created:

⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@dgroh It looks like the current directory is different at runtime and hence the app isn't finding the SQLite database file. Try deploying to the current directory of the app at runtime, or being more explicit about the path to the file in the connection string.
Hi @ajcvickers thanks. I figured it out. The trick was to make the .db file to Copy if newer or Copy always in the File properties -> Copy to output directory . I could not see this in the documentation.
Note from team discussion: this step isn't needed for ASP.NET Core, but is for other targets such as WPF.
Most helpful comment
Hi @ajcvickers thanks. I figured it out. The trick was to make the .db file to Copy if newer or Copy always in the
File properties -> Copy to output directory. I could not see this in the documentation.