小编moh*_*ani的帖子

错误“未应用迁移。数据库已经是最新的“

我正在使用 razor 页面和 EF 与 SQLite 构建一个 Web 应用程序。我正在 Linux 下使用 CORE SDK 进行开发。

添加后初始迁移没有问题dotnet ef migrations add InitialCreate。当我更新数据库时,我收到一条消息,指出未应用迁移。数据库已经是最新的了...

当我使用 SQLite 命令解释器(或运行应用程序)检查数据库时,除了空的迁移历史表之外,数据库不包含任何表。__EFMigrationsHistory

我运行 dotnet ef migrations add 时收到的信息消息

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using '/home/vagrant/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 2.0.1-rtm-125 initialized 'AgentContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: None
Done. To undo this action, use 'ef migrations remove
Run Code Online (Sandbox Code Playgroud)

运行 dotnet ef 数据库更新时收到的输出消息。

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User …
Run Code Online (Sandbox Code Playgroud)

c# asp.net sqlite asp.net-core razor-pages

5
推荐指数
0
解决办法
4508
查看次数

标签 统计

asp.net ×1

asp.net-core ×1

c# ×1

razor-pages ×1

sqlite ×1