[英]The method or operation is not implemented. while stopping IIS website in C#
[英]Error: The method or operation is not implemented. while scaffolding MYSQL Database
我正在使用.net core 2.0。 我安裝了以下nuget包:1: Microsoft.AspNetCore.All
2: Microsoft.EntityFrameworkCore.Tools
3: MySql.Data.EntityFrameworkCore
4: MySql.Data.EntityFrameworkCore.Design
當我嘗試在包管理器控制台中使用以下命令來構建數據庫時
Scaffold-DbContext "server=localhost;port=3306;user=root;password=mypass;database=SampleDB" MySql.Data.EntityFrameworkCore -OutputDir SampleEFMySQL -f
我得到以下錯誤。
System.NotImplementedException: The method or operation is not implemented.
at MySql.Data.EntityFrameworkCore.Scaffolding.Internal.MySQLDatabaseModelFactory.Create(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas)
at Microsoft.EntityFrameworkCore.Scaffolding.Internal.RelationalScaffoldingModelFactory.Create(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ModelScaffolder.Generate(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas, String projectPath, String outputPath, String rootNamespace, String contextName, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
The method or operation is not implemented.
如何使用Entity Framwork Core(在.net核心2.0中)使用MySQL
這似乎是Connector / NET中的一個錯誤: bug 89310 ,也報告為錯誤90368 。
很多人(例如, 這里和這里 )建議切換到Pomelo.EntityFrameworkCore.MySql (在.NET Core上使用帶有Entity Framework Core的MySQL)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.