entity-framework-core - 添加迁移 : Exception calling "AddFromFile" with "1" argument(s): "' basePath' cannot be an empty string ("")

标签 entity-framework-core

当我在任何基于 dotnetcore 的项目上使用 entitcore 运行 add-migration 时出现错误,但在针对完整的 dotnetframework 时,等效命令有效

添加迁移:使用“1”参数调用“AddFromFile”的异常:“'basePath'不能是空字符串(“”)

查看我的代码的快照。这是一个 dotnetcore 控制台应用程序。如果基于 dotnetframewok 4.6.1 创建项目,则同样有效
enter image description here

最佳答案

Add-Migration -Name "TestMigration" -Project BTrips.Domain

只需指定 -Name参数

关于entity-framework-core - 添加迁移 : Exception calling "AddFromFile" with "1" argument(s): "' basePath' cannot be an empty string (""),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42823847/

相关文章:

c# - 具有一对一关系的 EF Core 批量插入

c# - ASP.NET Core 依赖注入(inject),带参数注入(inject)

sql - .Net Core Entity Framework Linq Fluent API 查询不会创建/执行在数据库上运行的正确 SQL 查询

c# - 为什么我调用 ASPNET Core 2.1 Database Migrate 的实现实际上没有应用迁移?

c# - Entity Framework Core SelectMany 然后包含

middleware - Entity Framework Core 1.0 工作单元与 Asp.Net Core 中间件或 Mvc 过滤器

entity-framework - 在 EF Core 1.1 和 2.0 中使用相同的 EF 数据库路径

xamarin - 在 Android 7+ 上使用 EF7 SQLite

c# - 映射到关系类型时 EF Core 3 添加迁移失败

sql-server - 基于动态比较查找匹配实体