小编tot*_*123的帖子

EntityFramework Core 问题 - 尝试为身份表添加迁移 - SQLite

我创建了一个 Razor Pages web 应用程序,它有自己的上下文类,并且可以与 EF Core.Sqlite 一起使用

我决定将 Identity 添加到我的应用程序中,目前在尝试添加迁移时遇到了问题。我用谷歌搜索了错误,但没有任何乐趣。

PM> Add-Migration BakeryIdentity -Context BakeryAppUsersContext
Build started...
Build succeeded.
An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Method 'Create' in type 'Microsoft.EntityFrameworkCore.Sqlite.Query.Internal.SqliteQueryableMethodTranslatingExpressionVisitorFactory' from assembly 'Microsoft.EntityFrameworkCore.Sqlite, Version=3.1.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
Unable to create an object of type 'BakeryAppUsersContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
Run Code Online (Sandbox Code Playgroud)

BakerAppUsersContext是 Identity 创建的 Context 类。我已经在我的 Context 中注册了这个 Context 类Startup.cs …

c# sqlite entity-framework-core razor-pages asp.net-core-3.1

5
推荐指数
2
解决办法
1075
查看次数