1dotnet migrate command - .NET Core C.LNIEd(To1t)Cnoertemigrate command - .NET Core CLI(1)
2
3
4
7 dotnet migrate - Migrates a Preview 2 .NET Core project to a .NET Core
8 SDK 1.0 project.
9
11 dotnet migrate [<SOLUTION_FILE|PROJECT_DIR>] [--format-report-file-json] [-r|--report-file] [-s|--skip-project-references] [--skip-backup] [-t|--template-file] [-v|--sdk-package-version] [-x|--xproj-file]
12 dotnet migrate [-h|--help]
13
15 The dotnet migrate command migrates a valid Preview 2
16 project.json-based project to a valid .NET Core SDK 1.0 csproj project.
17
18 By default, the command migrates the root project and any project ref‐
19 erences that the root project contains. This behavior is disabled us‐
20 ing the --skip-project-references option at runtime.
21
22 Migration can be performed on the following assets:
23
24 · A single project by specifying the project.json file to migrate.
25
26 · All of the directories specified in the global.json file by passing
27 in a path to the global.json file.
28
29 · A solution.sln file, where it migrates the projects referenced in the
30 solution.
31
32 · On all subdirectories of the given directory recursively.
33
34 The dotnet migrate command keeps the migrated project.json file inside
35 a backup directory, which it creates if the directory doesn't exist.
36 This behavior is overridden using the --skip-backup option.
37
38 By default, the migration operation outputs the state of the migration
39 process to standard output (STDOUT). If you use the --report-file <RE‐
40 PORT_FILE> option, the output is saved to the file specify.
41
42 The dotnet migrate command only supports valid Preview 2
43 project.json-based projects. This means that you cannot use it to mi‐
44 grate DNX or Preview 1 project.json-based projects directly to MS‐
45 Build/csproj projects. You first need to manually migrate the project
46 to a Preview 2 project.json-based project and then use the dotnet mi‐
47 grate command to migrate the project.
48
49 Arguments
50 PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR
51
52 The path to one of the following:
53
54 · a project.json file to migrate.
55
56 · a global.json file: the folders specified in global.json are migrat‐
57 ed.
58
59 · a solution.sln file: the projects referenced in the solution are mi‐
60 grated.
61
62 · a directory to migrate: recursively searches for project.json files
63 to migrate inside the specified directory.
64
65 Defaults to current directory if nothing is specified.
66
68 --format-report-file-json <REPORT_FILE>
69
70 Output migration report file as JSON rather than user messages.
71
72 -h|--help
73
74 Prints out a short help for the command.
75
76 -r|--report-file <REPORT_FILE>
77
78 Output migration report to a file in addition to the console.
79
80 -s|--skip-project-references [Debug|Release]
81
82 Skip migrating project references. By default, project references are
83 migrated recursively.
84
85 --skip-backup
86
87 Skip moving project.json, global.json, and *.xproj to a backup directo‐
88 ry after successful migration.
89
90 -t|--template-file <TEMPLATE_FILE>
91
92 Template csproj file to use for migration. By default, the same tem‐
93 plate as the one dropped by dotnet new console is used.
94
95 -v|--sdk-package-version <VERSION>
96
97 The version of the sdk package that's referenced in the migrated app.
98 The default is the version of the SDK in dotnet new.
99
100 -x|--xproj-file <FILE>
101
102 The path to the xproj file to use. Required when there is more than
103 one xproj in a project directory.
104
106 Migrate a project in the current directory and all of its
107 project-to-project dependencies:
108
109 dotnet migrate
110
111 Migrate all projects that global.json file includes:
112
113 dotnet migrate path/to/global.json
114
115 Migrate only the current project and no project-to-project (P2P) depen‐
116 dencies. Also, use a specific SDK version:
117
118 dotnet migrate -s -v 1.0.0-preview4
119
121 mairaw.
122
123
124
125 dotnet migrate command - .NET Core CLI(1)