dotnet-migrate(1)
๐ dotnet-migrate(1) โ the .NET docs page, but make it cute โจ
okay so bestie, gather round, because we're reading dotnet-migrate(1) from the official .NET Documentation and it's giving legacy. Also heads up: This article applies to: โ๏ธ .NET Core 2.x SDK. That's the vibe. Let's get into it ๐
๐ NAME ๐
dotnet-migrate โ migrates a Preview 2 .NET Core project to a .NET Core SDK-style project. no cap, that's literally the whole job description ๐ฆ
โจ SYNOPSIS โจ
dotnet migrate [<SOLUTION_FILE|PROJECT_DIR>] [--format-report-file-json <REPORT_FILE>]
[-r|--report-file <REPORT_FILE>] [-s|--skip-project-references [Debug|Release]]
[--skip-backup] [-t|--template-file <TEMPLATE_FILE>] [-v|--sdk-package-version]
[-x|--xproj-file]
dotnet migrate -h|--help
look at her. iconic. ๐
๐ DESCRIPTION ๐
okay so first things first, and I need you to hear me on this one: 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. so like... it's a museum piece. beautiful, historic, do not build on it. ๐
By default, the command migrates the root project and any project references that the root project contains. That behavior gets 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.jsonfile to migrate. - All of the directories specified in the
global.jsonfile by passing in a path to theglobal.jsonfile. - A
solution.slnfile, 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. (so thoughtful of her ๐ซถ) 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 <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. ๐ฎโ๐จ (yes it's a whole two-step. she doesn't do glow-ups from scratch.)
๐ฆ ARGUMENTS ๐ฆ
PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR
The path to one of the following:
- a
project.jsonfile to migrate. - a
global.jsonfile: the folders specified inglobal.jsonare migrated. - a
solution.slnfile: the projects referenced in the solution are migrated. - a directory to migrate: recursively searches for
project.jsonfiles to migrate inside the specified directory.
Defaults to current directory if nothing is specified. ๐
๐ OPTIONS ๐
--format-report-file-json <REPORT_FILE>โ Output migration report file as JSON rather than user messages. ๐ง-h|--helpโ Prints out a short help for the command. (our emotional support flag fr fr)-r|--report-file <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 movingproject.json,global.json, and*.xprojto a backup directory after successful migration.-t|--template-file <TEMPLATE_FILE>โ Template csproj file to use for migration. By default, the same template as the one dropped bydotnet new consoleis used. โจ-v|--sdk-package-version <VERSION>โ The version of the sdk package that's referenced in the migrated app. The default is the version of the SDK indotnet new.-x|--xproj-file <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
ate. no crumbs. ๐ฅ
and that's the whole page bestie!! she was written for 2024-10-02 and she lives in the dotnet-migrate(1) manual section of the .NET docs โ deprecated queen, out-of-support legend, we love her, we do NOT use her in prod. ๐ bye!! ๐โจ
๐ฆ where this page comes from
- fedora 43: dotnet-host 9.0.8-1.fc43 ยท 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib
- ubuntu questing: dotnet-host-9.0 9.0.17-0ubuntu1~25.10.1
- ubuntu questing: dotnet-host-9.0 9.0.9-0ubuntu1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms