Skip to content

Commit 29ebe47

Browse files
authored
Document automatic migration for project.json in Visual Studio 2026 (#3478)
1 parent 9a2282c commit 29ebe47

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

docs/archive/project-json.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,35 @@ The [`project.lock.json`](#projectlockjson) file (described below) is also used
4242

4343
## Migrate project.json to PackageReference
4444

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:
4664

4765
1. Load the project.json project in Visual Studio.
4866
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...`
5068

5169
![Migrating from project.json to PackageReference](media/project-json-migrator.png)
5270

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).
5474

5575
## Dependencies
5676

docs/reference/errors-and-warnings/NU1016.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ Managing packages with project.json is deprecated. Migrate to PackageReference.
2121

2222
[Migrate your project from project.json to PackageReference](../../archive/project-json.md#migrate-projectjson-to-packagereference).
2323

24-
In Visual Studio 2026 or newer, your project.json project will be automatically migrated.
24+
**Visual Studio 2026 or later:**
2525

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:
2731

2832
1. Open your project.json project in Visual Studio
2933
1. In Solution Explorer, find the project's Dependencies node

0 commit comments

Comments
 (0)