Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlException: Invalid object name 'Serilogs'. #1176

Open
LokenLaishram opened this issue May 7, 2024 · 1 comment
Open

SqlException: Invalid object name 'Serilogs'. #1176

LokenLaishram opened this issue May 7, 2024 · 1 comment

Comments

@LokenLaishram
Copy link

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.

@wiecek1873
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants