微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 ef6.exe 错误迁移:值不能为 NULL参数名称:path1

如何解决使用 ef6.exe 错误迁移:值不能为 NULL参数名称:path1

我正在尝试使用 ef6.exe 从 CLI 迁移,但我不断收到错误消息,而且我无法弄清楚我遗漏了什么,因为数据库更新工作正常。我有两个具有不同配置的上下文。我明确地尝试了连接字符串,并从 web.config 获取它,但都没有帮助。

Scaffolding migration 'testMigration'.
System.ArgumentNullException: Value cannot be NULL.
Parameter name: path1
   at: System.IO.Path.Combine(String path1,String path2)
   at: System.Data.Entity.Tools.Commands.ProjectCommandBase.WriteMigration(ScaffoldedMigration scaffoldedMigration,Boolean rescaffolding,Boolean force,String name)
   at: System.Data.Entity.Tools.Commands.MigrationsAddCommand.Execute()
   at: Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
   at: System.Data.Entity.Tools.Program.Main(String[] args)
Value cannot be NULL.
Parameter name: path1

我正在使用的命令:

ef6.exe migrations add testMigration --migrations-config MyConfiguration --assembly MyAssembly.dll --connection-string-name “MyConnection” --config ..\Web.config --verbose  

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。