c# - Add-Migration fails because EntityFrameworkCore.Tools is not installed -
i want create console application ef core following tutorial: http://ef.readthedocs.io/en/latest/platforms/full-dotnet/new-db.html.
my problem is, cannot execute statement
add-migration
as described in tutorials. shows me:
pm> add-migration myfirstmigration cannot execute command because 'microsoft.entityframeworkcore.tools' not installed in project 'src\appef'. add 'microsoft.entityframeworkcore.tools' 'tools' section in project.json. see http://go.microsoft.com/fwlink/?linkid=798221 more details.
all added assemblies:
what wrong?
update
the statement dotnet restore
works , dotnet-ef --help
not work @ all.
and can see, statement execute in project folder.
as few people mentioned in comments, microsoft.entityframeworkcore.tools
needs added tools
section of project.json.
i've tested project.json latest (july 2016) versions of ef core , tooling packages, , works:
{ "buildoptions": { "emitentrypoint": true }, "dependencies": { "microsoft.entityframeworkcore.sqlserver": "1.0.0", "microsoft.entityframeworkcore.design": { "version": "1.0.0-preview2-final", "type": "build" }, "microsoft.netcore.app": { "type": "platform", "version": "1.0.0" } }, "frameworks": { "netcoreapp1.0": {} }, "tools": { "microsoft.entityframeworkcore.tools": "1.0.0-preview2-final" }, "version": "1.0.0-*" }
to use it, execute these commands inside project folder:
λ dotnet restore log : restore completed in 2810ms. λ dotnet ef --help compiling efcoretester2 .netcoreapp,version=v1.0 compilation succeeded. 0 warning(s) 0 error(s) time elapsed 00:00:01.7208394 entity framework .net core cli commands 1.0.0-preview2-21431 usage: dotnet ef [options] [command] options: -h|--help show information -v|--verbose enable verbose output --version show version information (... etc)
at first, getting no executable found matching command "dotnet-ef"
until realized have execute commands inside project folder (src\projectname
in case). if try solution root directory, won't work.
Comments
Post a Comment