jasontaylordev / CleanArchitecture

Clean Architecture Solution Template for ASP.NET Core

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SqlException: Invalid object name 'Serilogs'.

LokenLaishram opened this issue · comments

Microsoft.EntityFrameworkCore.DbUpdateException: 'An error occurred while saving the entity changes. See the inner exception for details.'
SqlException: Invalid object name 'Serilogs'.
Please help to fix this issue.

Hello!

Thank you for reporting this issue.

From the information you provided, it appears that there is a problem when updating your database. The SqlException with the message "Invalid object name 'Serilogs'" suggests that Entity Framework is trying to interact with a table named 'Serilogs', but this table does not exist in your database.

Here are some steps to help resolve this issue:

  1. Verify Table Existence:

    • Please check if the Serilogs table exists in your database schema.
      SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Serilogs';
  2. Apply Migrations:

    • If the table does not exist, ensure all migrations have been applied correctly and are up-to-date.
      dotnet ef migrations add "SampleMigration" --project src\Infrastructure --startup-project src\Web --output-dir Data\Migrations # Create sample migration 
      dotnet ef database update                    # Apply existing/pending migrations 

If these steps do not resolve your issue or if you need further assistance, please provide additional details about how you're configuring your database context so we can assist further.

Best regards,
Michał Więcek