0

I'm trying to deploy a database to a Windows Server machine.

The database is a SQL Server LocalDB. When I deploy it to a Windows machine, everything works correctly. When I try to deploy the same database, but to a Windows Server machine, everything is also ok, DB is created, but when I try to work with this database (Get account user data), I got an error:

Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration."

I guess changing AutomaticMigrationsEnabled to true is not a solution, as after trying to make it I got the other errors.

Also, when I use SQL Server Express Database, everything works without any issues. The issue is only when I use LocalDB together with a Windows Server.

Are there any ways to solve this issue?

5
  • What do you use to migrate?
    – Peter
    Commented Dec 6, 2022 at 12:01
  • @Peter Entity Framework. Code first migration. The error is got during processing my overridden GrantResourceOwnerCredentials method. Commented Dec 6, 2022 at 12:05
  • Why use LocalDB and not just SQL Server Express itself?
    – J.D.
    Commented Dec 6, 2022 at 13:25
  • @J.D. I'm using SQL Server Express, but also want to use LocalDB on purpose Commented Dec 6, 2022 at 13:51
  • I understand that, but why LocalDB?...what is your goal that you think you need it in addition to just SQL Server Express itself?
    – J.D.
    Commented Dec 6, 2022 at 14:55

0