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
* Cross-reference the full PackageReference documentation topic
from the first sentence.
* Update an existing link to the NuGet versioning topic (skip a
redirect).
* Note that the Version attribute is required, and mention the
defaults for the other, optional attributes.
Copy file name to clipboardExpand all lines: docs/core/tools/csproj.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -91,29 +91,31 @@ The root `<Project>` element of the *.csproj* file has a new attribute called `S
91
91
You need to have the `Sdk` attribute set to one of those IDs on the `<Project>` element in order to use the .NET Core tools and build your code.
92
92
93
93
### PackageReference
94
-
A `<PackageReference>` item element specifies a NuGet dependency in the project. The `Include` attribute specifies the package ID.
94
+
A `<PackageReference>` item element specifies a [NuGet dependency in the project](/nuget/consume-packages/package-references-in-project-files). The `Include` attribute specifies the package ID.
`Version` specifies the version of the package to restore. The attribute respects the rules of the [NuGet versioning](/nuget/create-packages/dependency-versions#version-ranges) scheme. The default behavior is an exact version match. For example, specifying `Version="1.2.3"` is equivalent to NuGet notation `[1.2.3]` for the exact 1.2.3 version of the package.
101
+
The required `Version`attribute specifies the version of the package to restore. The attribute respects the rules of the [NuGet versioning](/nuget/reference/package-versioning#version-ranges-and-wildcards) scheme. The default behavior is an exact version match. For example, specifying `Version="1.2.3"` is equivalent to NuGet notation `[1.2.3]` for the exact 1.2.3 version of the package.
102
102
103
103
#### IncludeAssets, ExcludeAssets and PrivateAssets
104
104
`IncludeAssets` attribute specifies which assets belonging to the package specified by `<PackageReference>` should be
105
-
consumed.
105
+
consumed. By default, all package assets are included.
106
106
107
107
`ExcludeAssets` attribute specifies which assets belonging to the package specified by `<PackageReference>` should not
108
108
be consumed.
109
109
110
110
`PrivateAssets` attribute specifies which assets belonging to the package specified by `<PackageReference>` should be
111
-
consumed but not flow to the next project.
111
+
consumed but not flow to the next project. The `Analyzers`, `Build` and `ContentFiles` assets are private by default
112
+
when this attribute is not present.
112
113
113
114
> [!NOTE]
114
115
> `PrivateAssets` is equivalent to the *project.json*/*xproj*`SuppressParent` element.
115
116
116
-
These attributes can contain one or more of the following items:
117
+
These attributes can contain one or more of the following items, separated by the semicolon `;` character if more than
118
+
one is listed:
117
119
118
120
*`Compile` – the contents of the lib folder are available to compile against.
119
121
*`Runtime` – the contents of the runtime folder are distributed.
0 commit comments