Issue with Blazor App Deployment: SQLite Table Missing and Pending Migrations

Yusuf 791 Reputation points
2024-07-31T15:48:59.3033333+00:00

Hi
I’ve created a Blazor 8 application using Scaffolder and SQLite in Visual Studio. I followed the steps provided in this tutorial https://youtu.be/tSUwr-R1JPQ. The application works fine when running on localhost, but when I try to deploy it, I encounter the error: SqliteException: SQLite Error 1: 'no such table: Book'.

Why does the application work correctly on localhost but face issues upon deployment? How can I resolve the connection string issue and apply the migrations successfully?

Thank you very much for your help.

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,578 questions
0 comments No comments
{count} votes

Accepted answer
  1. AgaveJoe 28,371 Reputation points
    2024-07-31T17:08:31.4233333+00:00

    Did you deploy the SQLite file with the application?

    Try clicking on the SQLite file in solution explorer. In the properties window make sure Copy to Output Directory is set to "Copy always". Then try redeploying the application.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.