You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/archive/project-json.md
+23-3Lines changed: 23 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,15 +42,35 @@ The [`project.lock.json`](#projectlockjson) file (described below) is also used
42
42
43
43
## Migrate project.json to PackageReference
44
44
45
-
The migration between project.json and PackageReference is straightforward. The easiest way to do it to use the built-in migrator in the latest Visual Studio 2022, Update 14.
45
+
The migration between project.json and PackageReference is straightforward.
46
+
47
+
### Automatic migration in Visual Studio 2026
48
+
49
+
Visual Studio 2026 and later automatically migrates project.json projects to PackageReference when you open a solution containing project.json projects.
50
+
The migration happens at solution load time:
51
+
52
+
1. Open a solution containing project.json projects in Visual Studio 2026 or later.
53
+
1. Visual Studio automatically detects project.json files and migrates them to PackageReference format.
54
+
1. To check migration status, open the [Output Window](/visualstudio/ide/output-window) and select Show output from "Package Manager".
55
+
You should see messages like "Migrating project.json project..." followed by "Migration Succeeded" for each project.
56
+
Any errors will appear in the Error List.
57
+
1. A backup of the original project file and project.json file is created in a `Backup` folder in the root of the project directory.
58
+
1. The migration converts all package dependencies to PackageReference format in the project file.
59
+
60
+
61
+
### Manual migration in Visual Studio 2022
62
+
63
+
For Visual Studio 2022 and earlier, you can use the built-in migrator:
46
64
47
65
1. Load the project.json project in Visual Studio.
48
66
1. Go to the solution explorer of the project.json project and find the dependencies node.
49
-
1.Click `Migrate project.json to PackageReference...`!
67
+
1.Right-click and select `Migrate project.json to PackageReference...`
50
68
51
69

52
70
53
-
Alternatively, you may use the [dotnet migrate](/dotnet/core/tools/dotnet-migrate), or do the migration manually by taking all of the content from the project.json file and replacing it with the equivalent [PackageReference syntax](../consume-packages/Package-References-in-Project-Files.md).
71
+
### Alternative migration methods
72
+
73
+
Alternatively, you may use the [dotnet migrate](/dotnet/core/tools/dotnet-migrate) command-line tool, or do the migration manually by taking all of the content from the project.json file and replacing it with the equivalent [PackageReference syntax](../consume-packages/Package-References-in-Project-Files.md).
Copy file name to clipboardExpand all lines: docs/reference/errors-and-warnings/NU1016.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,13 @@ Managing packages with project.json is deprecated. Migrate to PackageReference.
21
21
22
22
[Migrate your project from project.json to PackageReference](../../archive/project-json.md#migrate-projectjson-to-packagereference).
23
23
24
-
In Visual Studio 2026 or newer, your project.json project will be automatically migrated.
24
+
**Visual Studio 2026 or later:**
25
25
26
-
In Visual Studio 2022, you need to use the [built-in migrator](../../archive/project-json.md#migrate-projectjson-to-packagereference).
26
+
Your project.json project will be automatically migrated to PackageReference when you open the solution. Visual Studio will create a backup of the original files in a `Backup` folder in the project directory.
27
+
28
+
**Visual Studio 2022:**
29
+
30
+
You need to use the built-in migrator:
27
31
28
32
1. Open your project.json project in Visual Studio
29
33
1. In Solution Explorer, find the project's Dependencies node
0 commit comments