dotnet-installer/Documentation/manpages/sdk/dotnet-migrate.1

107 lines
4.3 KiB
Groff
Raw Normal View History

2018-03-30 15:45:24 +00:00
.\" Automatically generated by Pandoc 2.1.3
.\"
.TH "dotnet migrate command \- .NET Core CLI" "1" "" "" ".NET Core"
.hy
.SH dotnet migrate
.PP
.SH NAME
.PP
\f[C]dotnet\ migrate\f[] \- Migrates a Preview 2 .NET Core project to a .NET Core SDK 1.0 project.
.SH SYNOPSIS
.PP
\f[C]dotnet\ migrate\ [<SOLUTION_FILE|PROJECT_DIR>]\ [\-t|\-\-template\-file]\ [\-v|\-\-sdk\-package\-version]\ [\-x|\-\-xproj\-file]\ [\-s|\-\-skip\-project\-references]\ [\-r|\-\-report\-file]\ [\-\-format\-report\-file\-json]\ [\-\-skip\-backup]\ [\-h|\-\-help]\f[]
.SH DESCRIPTION
.PP
The \f[C]dotnet\ migrate\f[] command migrates a valid Preview 2 \f[I]project.json\f[]\-based project to a valid .NET Core SDK 1.0 \f[I]csproj\f[] project.
.PP
By default, the command migrates the root project and any project references that the root project contains.
This behavior is disabled using the \f[C]\-\-skip\-project\-references\f[] option at runtime.
.PP
Migration is performed on the following:
.IP \[bu] 2
A single project by specifying the \f[I]project.json\f[] file to migrate.
.IP \[bu] 2
All of the directories specified in the \f[I]global.json\f[] file by passing in a path to the \f[I]global.json\f[] file.
.IP \[bu] 2
A \f[I]solution.sln\f[] file, where it migrates the projects referenced in the solution.
.IP \[bu] 2
On all sub\-directories of the given directory recursively.
.PP
The \f[C]dotnet\ migrate\f[] command keeps the migrated \f[I]project.json\f[] file inside a \f[C]backup\f[] directory, which it creates if the directory doesn't exist.
This behavior is overridden using the \f[C]\-\-skip\-backup\f[] option.
.PP
By default, the migration operation outputs the state of the migration process to standard output (STDOUT).
If you use the \f[C]\-\-report\-file\ <REPORT_FILE>\f[] option, the output is saved to the file specify.
.PP
The \f[C]dotnet\ migrate\f[] command only supports valid Preview 2 \f[I]project.json\f[]\-based projects.
This means that you cannot use it to migrate DNX or Preview 1 \f[I]project.json\f[]\-based projects directly to MSBuild/csproj projects.
You first need to manually migrate the project to a Preview 2 \f[I]project.json\f[]\-based project and then use the \f[C]dotnet\ migrate\f[] command to migrate the project.
.SS Arguments
.PP
\f[C]PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR\f[]
.PP
The path to one of the following:
.IP \[bu] 2
a \f[I]project.json\f[] file to migrate.
.IP \[bu] 2
a \f[I]global.json\f[] file, it will migrate the folders specified in \f[I]global.json\f[].
.IP \[bu] 2
a \f[I]solution.sln\f[] file, it will migrate the projects referenced in the solution.
.IP \[bu] 2
a directory to migrate, it will recursively search for \f[I]project.json\f[] files to migrate.
.PP
Defaults to current directory if nothing is specified.
.SH OPTIONS
.PP
\f[C]\-h|\-\-help\f[]
.PP
Prints out a short help for the command.
.PP
\f[C]\-t|\-\-template\-file\ <TEMPLATE_FILE>\f[]
.PP
Template csproj file to use for migration.
By default, the same template as the one dropped by \f[C]dotnet\ new\ console\f[] is used.
.PP
\f[C]\-v|\-\-sdk\-package\-version\ <VERSION>\f[]
.PP
The version of the sdk package that's referenced in the migrated app.
The default is the version of the SDK in \f[C]dotnet\ new\f[].
.PP
\f[C]\-x|\-\-xproj\-file\ <FILE>\f[]
.PP
The path to the xproj file to use.
Required when there is more than one xproj in a project directory.
.PP
\f[C]\-s|\-\-skip\-project\-references\ [Debug|Release]\f[]
.PP
Skip migrating project references.
By default, project references are migrated recursively.
.PP
\f[C]\-r|\-\-report\-file\ <REPORT_FILE>\f[]
.PP
Output migration report to a file in addition to the console.
.PP
\f[C]\-\-format\-report\-file\-json\ <REPORT_FILE>\f[]
.PP
Output migration report file as JSON rather than user messages.
.PP
\f[C]\-\-skip\-backup\f[]
.PP
Skip moving \f[I]project.json\f[], \f[I]global.json\f[], and \f[I]*.xproj\f[] to a \f[C]backup\f[] directory after successful migration.
.SH EXAMPLES
.PP
Migrate a project in the current directory and all of its project\-to\-project dependencies:
.PP
\f[C]dotnet\ migrate\f[]
.PP
Migrate all projects that \f[I]global.json\f[] file includes:
.PP
\f[C]dotnet\ migrate\ path/to/global.json\f[]
.PP
Migrate only the current project and no project\-to\-project (P2P) dependencies.
Also, use a specific SDK version:
.PP
\f[C]dotnet\ migrate\ \-s\ \-v\ 1.0.0\-preview4\f[]
.SH AUTHORS
mairaw.