Open dgroh opened 4 years ago
@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.
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:
Here is how my Model looks like:
Below you can see that the migration and database were created:
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.