I'm trying to migrate from CLI using ef6.exe, but I keep getting the error, and I can't figure out what I'm missing, since database update works just fine. I have two contexts with different configurations. I tried expicitly the connection string, and getting it from web.config, neither helped.
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
The command I'm using:
ef6.exe migrations add testMigration --migrations-config MyConfiguration --assembly MyAssembly.dll --connection-string-name “MyConnection” --config ..\Web.config --verbose
You need to specify a value for the --project-dir
parameter. This is partly because it needs to know where to save the generated files.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.