From 3f2f4cc6d8a5c550133093a74e490b8eda4a7170 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Mon, 28 Sep 2020 16:01:57 -0700 Subject: [PATCH] Update instructions for installing dotnet ef Fixes #1588 --- .../core/get-started/install/index.md | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/entity-framework/core/get-started/install/index.md b/entity-framework/core/get-started/install/index.md index bda1bd2571..014e61f5cc 100644 --- a/entity-framework/core/get-started/install/index.md +++ b/entity-framework/core/get-started/install/index.md @@ -23,7 +23,7 @@ uid: core/get-started/install/index To add EF Core to an application, install the NuGet package for the database provider you want to use. -If you're building an ASP.NET Core application, you don't need to install the in-memory and SQL Server providers. Those providers are included in current versions of ASP.NET Core, alongside the EF Core runtime. +If you're building an ASP.NET Core application, you don't need to install the in-memory and SQL Server providers. Those providers are included in current versions of ASP.NET Core, alongside the EF Core runtime. To install or update NuGet packages, you can use the .NET Core command-line interface (CLI), the Visual Studio Package Manager Dialog, or the Visual Studio Package Manager Console. @@ -55,7 +55,7 @@ For more information, see [NuGet Package Manager Dialog](/nuget/tools/package-ma * To install the SQL Server provider, run the following command in the Package Manager Console: - ``` PowerShell + ``` PowerShell Install-Package Microsoft.EntityFrameworkCore.SqlServer ``` @@ -77,7 +77,7 @@ Two sets of tools are available: Although you can also use the `dotnet ef` commands from the Package Manager Console, it's recommended to use the Package Manager Console tools when you're using Visual Studio: -* They automatically work with the current project selected in the PMC in Visual Studio, without requiring manually switching directories. +* They automatically work with the current project selected in the PMC in Visual Studio, without requiring manually switching directories. * They automatically open files generated by the commands in Visual Studio after the command is completed. @@ -87,11 +87,21 @@ Although you can also use the `dotnet ef` commands from the Package Manager Cons .NET Core CLI tools require the .NET Core SDK, mentioned earlier in [Prerequisites](#prerequisites). -The `dotnet ef` commands are included in current versions of the .NET Core SDK, but to enable the commands on a specific project, you have to install the `Microsoft.EntityFrameworkCore.Design` package: +* `dotnet ef` must be installed as a global or local tool. Most developers prefer installing `dotnet ef` as a global tool using the following command: -```dotnetcli -dotnet add package Microsoft.EntityFrameworkCore.Design -``` + ```dotnetcli + dotnet tool install --global dotnet-ef + ``` + + `dotnet ef` can also be used as a local tool. To use it as a local tool, restore the dependencies of a project that declares it as a tooling dependency using a [tool manifest file](/dotnet/core/tools/global-tools#install-a-local-tool). + +* To update the tools, use the `dotnet tool update` command. + +* Install the latest `Microsoft.EntityFrameworkCore.Design` package. + + ```dotnetcli + dotnet add package Microsoft.EntityFrameworkCore.Design + ``` > [!IMPORTANT] > Always use the version of the tools package that matches the major version of the runtime packages.