From 4974211744ec12dc156fd44c48a569893b944c63 Mon Sep 17 00:00:00 2001 From: Meaghan Osagie Date: Mon, 29 Sep 2025 14:15:00 -0700 Subject: [PATCH] Remove references to the deprecated dotnet migrate command and add a new redirection for porting documentation --- .openpublishing.redirection.core.json | 4 + ...dotnet-restore-project-json-unsupported.md | 4 +- docs/core/tools/dotnet-migrate.md | 103 ------------------ docs/core/tools/dotnet.md | 1 - docs/core/tools/index.md | 1 - docs/navigate/tools-diagnostics/toc.yml | 2 - 6 files changed, 5 insertions(+), 110 deletions(-) delete mode 100644 docs/core/tools/dotnet-migrate.md diff --git a/.openpublishing.redirection.core.json b/.openpublishing.redirection.core.json index 6533ed21ccc4f..9a60376bf559f 100644 --- a/.openpublishing.redirection.core.json +++ b/.openpublishing.redirection.core.json @@ -1516,6 +1516,10 @@ { "source_path_from_root": "/docs/core/compatibility/sdk/9.0/nugetaudit-transitive-packages.md", "redirect_url": "/dotnet/core/compatibility/sdk/10.0/nugetaudit-transitive-packages" + }, + { + "source_path_from_root": "/docs/core/tools/dotnet-migrate.md", + "redirect_url": "/dotnet/core/porting" } ] } diff --git a/docs/core/compatibility/sdk/10.0/dotnet-restore-project-json-unsupported.md b/docs/core/compatibility/sdk/10.0/dotnet-restore-project-json-unsupported.md index 4feb15a2d811b..45f6a64dc7788 100644 --- a/docs/core/compatibility/sdk/10.0/dotnet-restore-project-json-unsupported.md +++ b/docs/core/compatibility/sdk/10.0/dotnet-restore-project-json-unsupported.md @@ -30,7 +30,7 @@ This change can affect [source compatibility](../../categories.md#source-compati The `project.json` format was originally available only in .NET Core previews (through Preview 2 of .NET Core 1.0) and was completely replaced by PackageReference in 2017. The format has been marked as deprecated since 2017. -When the `project.json` format was replaced, users migrated these projects using the [`dotnet migrate`](../../../tools/dotnet-migrate.md) command, but that command was removed from the CLI in the .NET Core 3.0 SDK. +When the `project.json` format was replaced, users migrated these projects using the `dotnet migrate` command, but that command was removed from the CLI in the .NET Core 3.0 SDK. The removal of `project.json` support completes this transition and allows the .NET team to focus on delivering a better experience for PackageReference-based projects. @@ -38,8 +38,6 @@ The removal of `project.json` support completes this transition and allows the . Migrate your `project.json` projects to use PackageReference format instead. -If you have .NET Core based `project.json` projects, you can use older versions of the .NET SDK that still include the [`dotnet migrate` command](../../../tools/dotnet-migrate.md) to convert them to the modern project format. - For more information about migrating from `project.json`, see [Migrating from project.json to .csproj](/nuget/archive/project-json#migrate-projectjson-to-packagereference). ## Affected APIs diff --git a/docs/core/tools/dotnet-migrate.md b/docs/core/tools/dotnet-migrate.md deleted file mode 100644 index 718f3d6284c87..0000000000000 --- a/docs/core/tools/dotnet-migrate.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: dotnet migrate command -description: The dotnet migrate command migrates a project and all of its dependencies. -ms.date: 02/14/2020 ---- -# dotnet migrate - -**This article applies to:** ✔️ .NET Core 2.x SDK - -## Name - -`dotnet migrate` - Migrates a Preview 2 .NET Core project to a .NET Core SDK-style project. - -## Synopsis - -```dotnetcli -dotnet migrate [] [--format-report-file-json ] - [-r|--report-file ] [-s|--skip-project-references [Debug|Release]] - [--skip-backup] [-t|--template-file ] [-v|--sdk-package-version] - [-x|--xproj-file] - -dotnet migrate -h|--help -``` - -## Description - -This command is deprecated. The `dotnet migrate` command is no longer available starting with .NET Core 3.0 SDK. It can only migrate a Preview 2 .NET Core project to a 1.x .NET Core project, which is out of support. - -By default, the command migrates the root project and any project references that the root project contains. This behavior is disabled using the `--skip-project-references` option at run time. - -Migration can be performed on the following assets: - -* A single project by specifying the *project.json* file to migrate. -* All of the directories specified in the *global.json* file by passing in a path to the *global.json* file. -* A *solution.sln* file, where it migrates the projects referenced in the solution. -* On all subdirectories of the given directory recursively. - -The `dotnet migrate` command keeps the migrated *project.json* file inside a `backup` directory, which it creates if the directory doesn't exist. This behavior is overridden using the `--skip-backup` option. - -By default, the migration operation outputs the state of the migration process to standard output (STDOUT). If you use the `--report-file ` option, the output is saved to the file specify. - -The `dotnet migrate` command only supports valid Preview 2 *project.json*-based projects. This means that you cannot use it to migrate DNX or Preview 1 *project.json*-based projects directly to MSBuild/csproj projects. You first need to manually migrate the project to a Preview 2 *project.json*-based project and then use the `dotnet migrate` command to migrate the project. - -## Arguments - -`PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR` - -The path to one of the following: - -* a *project.json* file to migrate. -* a *global.json* file: the folders specified in *global.json* are migrated. -* a *solution.sln* file: the projects referenced in the solution are migrated. -* a directory to migrate: recursively searches for *project.json* files to migrate inside the specified directory. - -Defaults to current directory if nothing is specified. - -## Options - -`--format-report-file-json ` - -Output migration report file as JSON rather than user messages. - -`-h|--help` - -Prints out a short help for the command. - -`-r|--report-file ` - -Output migration report to a file in addition to the console. - -`-s|--skip-project-references [Debug|Release]` - -Skip migrating project references. By default, project references are migrated recursively. - -`--skip-backup` - -Skip moving *project.json*, *global.json*, and *\*.xproj* to a `backup` directory after successful migration. - -`-t|--template-file ` - -Template csproj file to use for migration. By default, the same template as the one dropped by `dotnet new console` is used. - -`-v|--sdk-package-version ` - -The version of the sdk package that's referenced in the migrated app. The default is the version of the SDK in `dotnet new`. - -`-x|--xproj-file ` - -The path to the xproj file to use. Required when there is more than one xproj in a project directory. - -## Examples - -Migrate a project in the current directory and all of its project-to-project dependencies: - -`dotnet migrate` - -Migrate all projects that *global.json* file includes: - -`dotnet migrate path/to/global.json` - -Migrate only the current project and no project-to-project (P2P) dependencies. Also, use a specific SDK version: - -`dotnet migrate -s -v 1.0.0-preview4` diff --git a/docs/core/tools/dotnet.md b/docs/core/tools/dotnet.md index 03cfa024da649..42e0251684f76 100644 --- a/docs/core/tools/dotnet.md +++ b/docs/core/tools/dotnet.md @@ -170,7 +170,6 @@ The following options are available only when `dotnet` runs an application by us | [dotnet clean](dotnet-clean.md) | Clean build outputs. | | [dotnet exec](#options-for-running-an-application) | Runs a .NET application. | | [dotnet help](dotnet-help.md) | Shows more detailed documentation online for the command. | -| [dotnet migrate](dotnet-migrate.md) | Migrates a valid Preview 2 project to a .NET Core SDK 1.0 project. | | [dotnet msbuild](dotnet-msbuild.md) | Provides access to the MSBuild command line. | | [dotnet new](dotnet-new.md) | Initializes a C# or F# project for a given template. | | [dotnet pack](dotnet-pack.md) | Creates a NuGet package of your code. | diff --git a/docs/core/tools/index.md b/docs/core/tools/index.md index 33c8da824c4bc..71834baee6a77 100644 --- a/docs/core/tools/index.md +++ b/docs/core/tools/index.md @@ -64,7 +64,6 @@ The following commands are installed by default: - [`test`](dotnet-test.md) - [`vstest`](dotnet-vstest.md) - [`pack`](dotnet-pack.md) -- [`migrate`](dotnet-migrate.md) - [`clean`](dotnet-clean.md) - [`sln`](dotnet-sln.md) - [`help`](dotnet-help.md) diff --git a/docs/navigate/tools-diagnostics/toc.yml b/docs/navigate/tools-diagnostics/toc.yml index 52b37667a3956..ea3ac36855a4f 100644 --- a/docs/navigate/tools-diagnostics/toc.yml +++ b/docs/navigate/tools-diagnostics/toc.yml @@ -116,8 +116,6 @@ items: href: ../../core/tools/dotnet-format.md - name: dotnet help href: ../../core/tools/dotnet-help.md - - name: dotnet migrate - href: ../../core/tools/dotnet-migrate.md - name: dotnet msbuild href: ../../core/tools/dotnet-msbuild.md - name: dotnet new