You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commands: Assembly-based Command Line Interface (ef.exe) #646
Like dotnet-ef but with less project.json and more *.dll
A rudimentary version of this is available in the Microsoft.EntityFrameworkCore.Tools package (under the tools directory), but it is currently just an implementation detail of the PMC commands.
changed the title [-]Migrations: Command Line Interface (ef.exe)[/-][+]Migrations: Command Line Interface (ef.exe) a.k.a non-DNX non-VS CLI[/+]on Jul 24, 2015
We could probably have just an ef driver that is smart enough to delegate based on the assemblies passed in.
With the driver, we could even hide the fact that there are multiple versions by packaging them into the driver and extracting them behind the scenes.
I wonder if we could use the fact that .NET Core unifies on Full .NET to our advantage in the architecture... Something like a single "portable" assembly that we run via the appropriate CLR/CoreCLR host.
changed the title [-]Migrations: Command Line Interface (ef.exe) a.k.a non-DNX non-VS CLI[/-][+]Commands: Assembly-based Command Line Interface (ef.exe)[/+]on Mar 8, 2016
hello... not understanding which versions --assembly is expected to work in...
i'm trying to run migrations on a published dll and --assembly doesn't seem to fix the missing project error:
(note that i'm using dotnet-ef.dll published along with my app because i added a PackageReference on <PackageReference Include="Microsoft.EntityFrameworkCored.Tools.DotNet" Version="2.1.0-preview1-final" />)
root@82332f775c88:/app# dotnet exec --depsfile KanbanLab.FrontEnd.deps.json --runtimeconfig KanbanLab.FrontEnd.runtimeconfig.json Microsoft.EntityFrameworkCore.Design.dll database update --assembly KanbanLab.FrontEnd.dll --startup-assembly KanbanLab.FrontEnd.dll --verbose --context KanbanContext
Unhandled Exception: System.MissingMethodException: Entry point not found in assembly 'Microsoft.EntityFrameworkCore.Design, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
Aborted
root@82332f775c88:/app# dotnet exec --depsfile KanbanLab.FrontEnd.deps.json --runtimeconfig KanbanLab.FrontEnd.runtimeconfig.json dotnet-ef.dll database update --assembly KanbanLab.FrontEnd.dll --startup-assembly KanbanLab.FrontEnd.dll --verbose --context KanbanContext
Microsoft.EntityFrameworkCore.Tools.CommandException: No project was found. Change the current working directory or use the --project option.
at Microsoft.EntityFrameworkCore.Tools.RootCommand.FindProjects(String path, String errorWhenNoProject, String errorWhenMultipleProjects)
at Microsoft.EntityFrameworkCore.Tools.RootCommand.Execute()
at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)
No project was found. Change the current working directory or use the --project option.
root@82332f775c88:/app# dotnet exec --depsfile KanbanLab.FrontEnd.deps.json --runtimeconfig KanbanLab.FrontEnd.runtimeconfig.json dotnet-ef.dll --assembly KanbanLab.FrontEnd.dll --startup-assembly KanbanLab.FrontEnd.dll database update --verbose --context KanbanContext
_/\__
---==/ \\
___ ___ |. \|\
| __|| __|| ) \\\
| _|| _|\_/ | //|\\|___||_| / \\\/\\
Entity Framework Core .NET Command-line Tools 2.1.0-preview1-28290
Usage: dotnet ef [options] [command]
Options:
--version Show version information
-h|--help Show help information
-v|--verbose Show verbose output.
--no-color Don't colorize output. --prefix-output Prefix output with level.Commands: database Commands to manage the database. dbcontext Commands to manage DbContext types. migrations Commands to manage migrations.Use "dotnet ef [command] --help" for more information about a command.root@82332f775c88:/app# efbash: ef: command not foundroot@82332f775c88:/app# dotnet dotnet-ef.dllA fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/app/'.Failed to run as a self-contained app. If this should be a framework-dependent app, add the /app/dotnet-ef.runtimeconfig.json file specifying the appropriate framework.root@82332f775c88:/app# dotnet exec --depsfile KanbanLab.FrontEnd.deps.json --runtimeconfig KanbanLab.FrontEnd.runtimeconfig.json dotnet-ef.dll --assembly KanbanLab.FrontEnd.dll --startup-assembly KanbanLab.FrontEnd.dll database update --verbose --context KanbanContext _/\__ ---==/ \\ ___ ___ |. \|\ | __|| __| | ) \\\ | _| | _| \_/ | //|\\ |___||_| / \\\/\\Entity Framework Core .NET Command-line Tools 2.1.0-preview1-28290Usage: dotnet ef [options] [command]Options: --version Show version information -h|--help Show help information -v|--verbose Show verbose output. --no-color Don't colorize output.
--prefix-output Prefix output with level.
Commands:
database Commands to manage the database.
dbcontext Commands to manage DbContext types.
migrations Commands to manage migrations.
Use "dotnet ef [command] --help"for more information about a command.
Activity
[-][Beta Must Have] Migrations: Command Line Interface (ef.exe)[/-][+]Migrations: Command Line Interface (ef.exe)[/+][-]Migrations: Command Line Interface (ef.exe)[/-][+]Migrations: Command Line Interface (ef.exe) a.k.a non-DNX non-VS CLI[/+]bricelam commentedon Mar 8, 2016
We'll probably need a few different versions.
We could probably have just an
efdriver that is smart enough to delegate based on the assemblies passed in.With the driver, we could even hide the fact that there are multiple versions by packaging them into the driver and extracting them behind the scenes.
I wonder if we could use the fact that .NET Core unifies on Full .NET to our advantage in the architecture... Something like a single "portable" assembly that we run via the appropriate CLR/CoreCLR host.
[-]Migrations: Command Line Interface (ef.exe) a.k.a non-DNX non-VS CLI[/-][+]Commands: Assembly-based Command Line Interface (ef.exe)[/+]30 remaining items
bricelam commentedon Jan 12, 2017
We've decided to leave
--assemblyas a named parameter.bricelam commentedon Jan 12, 2017
I believe it's ready for prime time. I've filed dotnet/EntityFramework.Docs#328 to document it.
andycmaj commentedon Jul 4, 2018
hello... not understanding which versions
--assemblyis expected to work in...i'm trying to run migrations on a published dll and
--assemblydoesn't seem to fix the missing project error:(note that i'm using
dotnet-ef.dllpublished along with my app because i added aPackageReferenceon<PackageReference Include="Microsoft.EntityFrameworkCored.Tools.DotNet" Version="2.1.0-preview1-final" />)andycmaj commentedon Jul 4, 2018
ended up snatching
ef.dllfrom the package cache during my builds...so now i can publish with
ef.dlland this seems to actually work for migrations, rather thandotnet-ef.dll