Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion entity-framework/core/cli/dbcontext-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Both <xref:Microsoft.EntityFrameworkCore.Design.IDesignTimeDbContextFactory`1.Cr

You can specify these arguments from the tools:

### [.NET Core CLI](#tab/dotnet-core-cli)
### [.NET CLI](#tab/dotnet-core-cli)

```dotnetcli
dotnet ef database update -- --environment Production
Expand Down
14 changes: 7 additions & 7 deletions entity-framework/core/cli/dotnet.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: EF Core tools reference (.NET CLI) - EF Core
description: Reference guide for the Entity Framework Core .NET Core CLI tools
description: Reference guide for the Entity Framework Core .NET CLI tools
author: SamMonoRT
ms.date: 11/08/2024
uid: core/cli/dotnet
---

# Entity Framework Core tools reference - .NET Core CLI
# Entity Framework Core tools reference - .NET CLI

The command-line interface (CLI) tools for Entity Framework Core perform design-time development tasks. For example, they create [migrations](/aspnet/core/data/ef-mvc/migrations), apply migrations, and generate code for a model based on an existing database. The commands are an extension to the cross-platform [dotnet](/dotnet/core/tools) command, which is part of the [.NET Core SDK](https://www.microsoft.com/net/core). These tools work with .NET Core projects.
The command-line interface (CLI) tools for Entity Framework Core perform design-time development tasks. For example, they create [migrations](/aspnet/core/data/ef-mvc/migrations), apply migrations, and generate code for a model based on an existing database. The commands are an extension to the cross-platform [dotnet](/dotnet/core/tools) command, which is part of the [.NET SDK](https://www.microsoft.com/net/core). These tools work with .NET projects.

When using Visual Studio, consider using the [Package Manager Console tools](xref:core/cli/powershell) instead of the CLI tools. Package Manager Console tools automatically:

Expand Down Expand Up @@ -80,19 +80,19 @@ The commands refer to a *project* and a *startup project*.

The startup project and target project are often the same project. A typical scenario where they are separate projects is when:

* The EF Core context and entity classes are in a .NET Core class library.
* A .NET Core console app or web app references the class library.
* The EF Core context and entity classes are in a .NET class library.
* A .NET console app or web app references the class library.

It's also possible to [put migrations code in a class library separate from the EF Core context](xref:core/managing-schemas/migrations/projects).

### Other target frameworks

The CLI tools work with .NET Core projects and .NET Framework projects. Apps that have the EF Core model in a .NET Standard class library might not have a .NET Core or .NET Framework project. For example, this is true of Xamarin and Universal Windows Platform apps. In such cases, you can create a .NET Core console app project whose only purpose is to act as startup project for the tools. The project can be a dummy project with no real code &mdash; it is only needed to provide a target for the tooling.
The CLI tools work with .NET projects and .NET Framework projects. Apps that have the EF Core model in a .NET Standard class library might not have a .NET or .NET Framework project. For example, this is true of Xamarin and Universal Windows Platform apps. In such cases, you can create a .NET console app project whose only purpose is to act as startup project for the tools. The project can be a dummy project with no real code &mdash; it is only needed to provide a target for the tooling.

> [!IMPORTANT]
> Xamarin.Android, Xamarin.iOS, Xamarin.Mac are now integrated directly into .NET (starting with .NET 6) as .NET for Android, .NET for iOS, and .NET for macOS. If you're building with these project types today, they should be upgraded to .NET SDK-style projects for continued support. For more information about upgrading Xamarin projects to .NET, see the [Upgrade from Xamarin to .NET & .NET MAUI](/dotnet/maui/migration) documentation.

Why is a dummy project required? As mentioned earlier, the tools have to execute application code at design time. To do that, they need to use the .NET Core runtime. When the EF Core model is in a project that targets .NET Core or .NET Framework, the EF Core tools borrow the runtime from the project. They can't do that if the EF Core model is in a .NET Standard class library. The .NET Standard is not an actual .NET implementation; it's a specification of a set of APIs that .NET implementations must support. Therefore .NET Standard is not sufficient for the EF Core tools to execute application code. The dummy project you create to use as startup project provides a concrete target platform into which the tools can load the .NET Standard class library.
Why is a dummy project required? As mentioned earlier, the tools have to execute application code at design time. To do that, they need to use the .NET runtime. When the EF Core model is in a project that targets .NET or .NET Framework, the EF Core tools borrow the runtime from the project. They can't do that if the EF Core model is in a .NET Standard class library. The .NET Standard is not an actual .NET implementation; it's a specification of a set of APIs that .NET implementations must support. Therefore .NET Standard is not sufficient for the EF Core tools to execute application code. The dummy project you create to use as startup project provides a concrete target platform into which the tools can load the .NET Standard class library.

### ASP.NET Core environment

Expand Down
2 changes: 1 addition & 1 deletion entity-framework/core/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Either of the following tools can be installed, as both tools expose the same fu

* The [EF Core Package Manager Console tools](xref:core/cli/powershell) run in the [Package Manager Console](/nuget/tools/package-manager-console) in Visual Studio. We recommend using these tools if you are developing in Visual Studio as they provide a more integrated experience.

* The [EF Core .NET command-line interface (CLI) tools](xref:core/cli/dotnet) are an extension to the cross-platform [.NET Core CLI tools](/dotnet/core/tools/). These tools require a .NET Core SDK project (one with `Sdk="Microsoft.NET.Sdk"` or similar in the project file).
* The [EF Core .NET command-line interface (CLI) tools](xref:core/cli/dotnet) are an extension to the cross-platform [.NET CLI tools](/dotnet/core/tools/). These tools require a .NET SDK project (one with `Sdk="Microsoft.NET.Sdk"` or similar in the project file).

## Next steps

Expand Down
12 changes: 6 additions & 6 deletions entity-framework/core/cli/powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ uid: core/cli/powershell
---
# Entity Framework Core tools reference - Package Manager Console in Visual Studio

The Package Manager Console (PMC) tools for Entity Framework Core perform design-time development tasks. For example, they create [migrations](/aspnet/core/data/ef-mvc/migrations), apply migrations, and generate code for a model based on an existing database. The commands run inside of Visual Studio using the [Package Manager Console](/nuget/tools/package-manager-console). These tools work with both .NET Framework and .NET Core projects.
The Package Manager Console (PMC) tools for Entity Framework Core perform design-time development tasks. For example, they create [migrations](/aspnet/core/data/ef-mvc/migrations), apply migrations, and generate code for a model based on an existing database. The commands run inside of Visual Studio using the [Package Manager Console](/nuget/tools/package-manager-console). These tools work with both .NET Framework and .NET projects.

If you aren't using Visual Studio, we recommend the [EF Core Command-line Tools](xref:core/cli/dotnet) instead. The .NET Core CLI tools are cross-platform and run inside a command prompt.
If you aren't using Visual Studio, we recommend the [EF Core Command-line Tools](xref:core/cli/dotnet) instead. The .NET CLI tools are cross-platform and run inside a command prompt.

[!INCLUDE [managed-identities-test-non-production](~/core/includes/managed-identities-test-non-production.md)]

Expand Down Expand Up @@ -73,19 +73,19 @@ The commands refer to a *project* and a *startup project*.

The startup project and target project are often the same project. A typical scenario where they are separate projects is when:

* The EF Core context and entity classes are in a .NET Core class library.
* A .NET Core console app or web app references the class library.
* The EF Core context and entity classes are in a .NET class library.
* A .NET console app or web app references the class library.

It's also possible to [put migrations code in a class library separate from the EF Core context](xref:core/managing-schemas/migrations/projects).

### Other target frameworks

The Package Manager Console tools work with .NET Core or .NET Framework projects. Apps that have the EF Core model in a .NET Standard class library might not have a .NET Core or .NET Framework project. For example, this is true of Xamarin and Universal Windows Platform apps. In such cases, you can create a .NET Core or .NET Framework console app project whose only purpose is to act as startup project for the tools. The project can be a dummy project with no real code &mdash; it is only needed to provide a target for the tooling.
The Package Manager Console tools work with .NET or .NET Framework projects. Apps that have the EF Core model in a .NET Standard class library might not have a .NET or .NET Framework project. For example, this is true of Xamarin and Universal Windows Platform apps. In such cases, you can create a .NET or .NET Framework console app project whose only purpose is to act as startup project for the tools. The project can be a dummy project with no real code &mdash; it is only needed to provide a target for the tooling.

> [!IMPORTANT]
> Xamarin.Android, Xamarin.iOS, Xamarin.Mac are now integrated directly into .NET (starting with .NET 6) as .NET for Android, .NET for iOS, and .NET for macOS. If you're building with these project types today, they should be upgraded to .NET SDK-style projects for continued support. For more information about upgrading Xamarin projects to .NET, see the [Upgrade from Xamarin to .NET & .NET MAUI](/dotnet/maui/migration) documentation.

Why is a dummy project required? As mentioned earlier, the tools have to execute application code at design time. To do that, they need to use the .NET Core or .NET Framework runtime. When the EF Core model is in a project that targets .NET Core or .NET Framework, the EF Core tools borrow the runtime from the project. They can't do that if the EF Core model is in a .NET Standard class library. The .NET Standard is not an actual .NET implementation; it's a specification of a set of APIs that .NET implementations must support. Therefore .NET Standard is not sufficient for the EF Core tools to execute application code. The dummy project you create to use as startup project provides a concrete target platform into which the tools can load the .NET Standard class library.
Why is a dummy project required? As mentioned earlier, the tools have to execute application code at design time. To do that, they need to use the .NET or .NET Framework runtime. When the EF Core model is in a project that targets .NET or .NET Framework, the EF Core tools borrow the runtime from the project. They can't do that if the EF Core model is in a .NET Standard class library. The .NET Standard is not an actual .NET implementation; it's a specification of a set of APIs that .NET implementations must support. Therefore .NET Standard is not sufficient for the EF Core tools to execute application code. The dummy project you create to use as startup project provides a concrete target platform into which the tools can load the .NET Standard class library.

### ASP.NET Core environment

Expand Down
4 changes: 2 additions & 2 deletions entity-framework/core/get-started/overview/first-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ uid: core/get-started/overview/first-app

# Getting Started with EF Core

In this tutorial, you create a .NET Core console app that performs data access against a SQLite database using Entity Framework Core.
In this tutorial, you create a .NET console app that performs data access against a SQLite database using Entity Framework Core.

You can follow the tutorial by using Visual Studio on Windows, or by using the .NET CLI on Windows, macOS, or Linux.

Expand Down Expand Up @@ -51,7 +51,7 @@ cd EFGetStarted

To install EF Core, you install the package for the EF Core database provider(s) you want to target. This tutorial uses SQLite because it runs on all platforms that .NET supports. For a list of available providers, see [Database Providers](xref:core/providers/index).

### [.NET Core CLI](#tab/netcore-cli)
### [.NET CLI](#tab/netcore-cli)

```dotnetcli
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
Expand Down
12 changes: 6 additions & 6 deletions entity-framework/core/get-started/overview/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ uid: core/get-started/overview/install

EF Core is shipped as [NuGet packages](https://www.nuget.org/). To add EF Core to an application, install the NuGet package for the database provider you want to use. See [_Providers_](xref:core/providers/index) for a list of the database providers available.

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.
To install or update NuGet packages, you can use the .NET command-line interface (CLI), the Visual Studio Package Manager Dialog, or the Visual Studio Package Manager Console.

### .NET Core CLI
### .NET CLI

* Use the following .NET Core CLI command from the operating system's command line to install or update the EF Core SQL Server provider:
* Use the following .NET CLI command from the operating system's command line to install or update the EF Core SQL Server provider:

```dotnetcli
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
Expand Down Expand Up @@ -64,15 +64,15 @@ You can install tools to carry out EF Core-related tasks in your project, like c

Two sets of tools are available:

* The [.NET Core command-line interface (CLI) tools](xref:core/cli/dotnet) can be used on Windows, Linux, or macOS. These commands begin with `dotnet ef`.
* The [.NET command-line interface (CLI) tools](xref:core/cli/dotnet) can be used on Windows, Linux, or macOS. These commands begin with `dotnet ef`.

* The [Package Manager Console (PMC) tools](xref:core/cli/powershell) run in Visual Studio on Windows. These commands start with a verb, for example `Add-Migration`, `Update-Database`.

<a name="cli"></a>

### Get the .NET Core CLI tools
### Get the .NET CLI tools

.NET Core CLI tools require the .NET Core SDK, mentioned earlier in [Prerequisites](#prerequisites).
.NET CLI tools require the .NET SDK, mentioned earlier in [Prerequisites](#prerequisites).

* `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:

Expand Down
2 changes: 1 addition & 1 deletion entity-framework/core/get-started/wpf.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You need to have Visual Studio 2019 16.3 or later installed with the **.NET desk

1. Open Visual Studio
2. On the start window, choose **Create new project**.
3. Search for "WPF," choose **WPF App (.NET Core)** and then choose **Next**.
3. Search for "WPF," choose **WPF App (.NET)** and then choose **Next**.
4. At the next screen, give the project a name, for example, **GetStartedWPF**, and choose **Create.**

## Install the Entity Framework NuGet packages
Expand Down
14 changes: 7 additions & 7 deletions entity-framework/core/learn-more/community-standups.md
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ Links:

### Aug 10: [CoreWCF: Roadmap and Q&A](https://www.youtube.com/live/OvaYdycmb-U?si=ucnqZXAoXDSCMZqE)

CoreWCF is a port of the service side of Windows Communication Foundation (WCF) to .NET Core. The goal of this project is to enable existing WCF services to move to .NET Core. The CoreWCF team recently conducted a survey and will be talking about some of the responses, answering questions, and sharing insights into their roadmap for the future.
CoreWCF is a port of the service side of Windows Communication Foundation (WCF) to .NET. The goal of this project is to enable existing WCF services to move to .NET. The CoreWCF team recently conducted a survey and will be talking about some of the responses, answering questions, and sharing insights into their roadmap for the future.

Featuring:

Expand Down Expand Up @@ -1709,7 +1709,7 @@ Links:

### Sep 30: [Geographic Data with NetTopologySuite](https://www.youtube.com/live/IHslY5rrxD0?si=QpNNSZql1UsydmHz)

Joe Amenta joins us to discuss how to add spatial data to your applications to open a world of new relationships between data. He will demonstrate the "status quote" for querying spatial data from .NET Core and demo integrations with NetTopologSuite and EF Core.
Joe Amenta joins us to discuss how to add spatial data to your applications to open a world of new relationships between data. He will demonstrate the "status quote" for querying spatial data from .NET and demo integrations with NetTopologSuite and EF Core.

Featuring:

Expand Down Expand Up @@ -1790,7 +1790,7 @@ Links:

### Aug 5: [EF Core In Depth Video Series](https://www.youtube.com/live/b-zTazj2vuI?si=A9lCvvHva3AomWe7)

Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET Core, Languages, CLI, MSBuild, and more.
Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET, Languages, CLI, MSBuild, and more.

Featuring:

Expand All @@ -1813,7 +1813,7 @@ Links:

### Jul 22: [Using Scaffolding with Handlebars](https://www.youtube.com/live/6Ux7EpgiWXE?si=78XhoFrViXVkMXOL)

Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET Core, Languages, CLI, MSBuild, and more.
Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET, Languages, CLI, MSBuild, and more.

Featuring:

Expand All @@ -1839,7 +1839,7 @@ Links:

### Jun 24: [EF Core in Blazor](https://www.youtube.com/live/HNJYIqeBLQc?si=xvEObLRdY37_0L87)

Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET Core, Languages, CLI, MSBuild, and more.
Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET, Languages, CLI, MSBuild, and more.

Featuring:

Expand All @@ -1861,7 +1861,7 @@ Links:

### Jun 10: [EF Core Power Tools](https://www.youtube.com/live/OWuP_qOYwsk?si=VoSGWW6CfR8-x46P)

Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET Core, Languages, CLI, MSBuild, and more.
Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET, Languages, CLI, MSBuild, and more.

Featuring:

Expand All @@ -1881,7 +1881,7 @@ Links:

### May 6: [Introducing the EF Core Community Standup](https://www.youtube.com/live/j1sGgfCxhp0?si=VQBMex-9-me9JhAB)

Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET Core, Languages, CLI, MSBuild, and more.
Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET, Languages, CLI, MSBuild, and more.

Featuring:

Expand Down
Loading