dotnet-migrate(1)

๐Ÿ“ฆ
version 9.0.17 ยท 4 versions
, in fedora 43, ubuntu questing

๐Ÿ‘‘ 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.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. (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.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 <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 moving project.json, global.json, and *.xproj to 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 by dotnet new console is 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 in dotnet 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