Skip to content

Commit f204fb6

Browse files
authored
Document the project.json migrator (#3389)
1 parent 63ac1d5 commit f204fb6

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed
33 KB
Loading

docs/archive/project-json-and-uwp.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ms.topic: conceptual
1010
# project.json and UWP
1111

1212
> [!Important]
13-
> This content is deprecated. Projects should use either the `packages.config` or PackageReference formats.
13+
> This content is deprecated. Projects should use the PackageReference formats.
14+
> Learn how to [migrate your project.json project to PackageReference](./project-json.md#migrate-projectjson-to-packagereference).
1415
1516
This document describes the package structure that employs features in NuGet 3+ (Visual Studio 2015 and later). The `minClientVersion` property of your `.nuspec` can be used to state that you require the features described here by setting it to 3.1.
1617

docs/archive/project-json-impact.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ms.topic: conceptual
1010
# Impact of project.json when creating packages
1111

1212
> [!Important]
13-
> This content is deprecated. Projects should use either the `packages.config` or PackageReference formats.
13+
> This content is deprecated. Projects should use the PackageReference formats.
14+
> Learn how to [migrate your project.json project to PackageReference](./project-json.md#migrate-projectjson-to-packagereference).
1415
1516
The `project.json` system used in NuGet 3+ affects package authors in several ways as described in the following sections.
1617

docs/archive/project-json.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ ms.topic: reference
1010
# project.json reference
1111

1212
> [!Important]
13-
> This content is deprecated. Projects should use either the `packages.config` or PackageReference formats.
13+
> This content is deprecated. Projects should use the PackageReference formats.
14+
> Learn how to [migrate your project.json project to PackageReference](#migrate-projectjson-to-packagereference).
1415
15-
*NuGet 3.x+*
16+
*NuGet 3.x*
1617

1718
The `project.json` file maintains a list of packages used in a project, known as a package management format. It supersedes `packages.config` but is in turn superseded by [PackageReference](../consume-packages/package-references-in-project-files.md) with NuGet 4.0+.
1819

@@ -37,6 +38,18 @@ The [`project.lock.json`](#projectlockjson) file (described below) is also used
3738
}
3839
```
3940

41+
## Migrate project.json to PackageReference
42+
43+
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.
44+
45+
1. Load the project.json project in Visual Studio.
46+
1. Go to the solution explorer of the project.json project and find the dependencies node.
47+
1. Click `Migrate project.json to PackageReference...`!
48+
49+
![Migrating from project.json to PackageReference](media/project-json-migrator.png)
50+
51+
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).
52+
4053
## Dependencies
4154

4255
Lists the NuGet package dependencies of your project in the following form:

0 commit comments

Comments
 (0)