Skip to content

Commit d4c51f8

Browse files
authored
Merge pull request NuGet#2710 from NuGet/dev-nkolev92-clarifyPrivateAssets
Add content files where appropriate in select assemblies to be referenced by projects
2 parents 63f74ff + c460fef commit d4c51f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/create-packages/Select-assemblies-referenced-by-projects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Assemblies are used in two different ways during a build. The first is for compi
1313

1414
## Recommended: One assembly per package
1515

16-
Our recommendation is to have one package per assembly, and package dependencies to other assemblies. When NuGet restores a project, it does asset selection and supports including, excluding, and making private different asset classes. In order to prevent your package's dependencies from becoming compile time assets for anyone using your package, you can make `compile` assets private. In the generated package, that will cause `compile` to be excluded from the dependency. Note that the default private assets when none is supplied is `build;analyzers`. Therefore, you should use `PrivateAssets="compile;build;analyzers"` in your `PackageReference` or `ProjectReference`.
16+
Our recommendation is to have one package per assembly, and package dependencies to other assemblies. When NuGet restores a project, it does asset selection and supports including, excluding, and making private different asset classes. In order to prevent your package's dependencies from becoming compile time assets for anyone using your package, you can make `compile` assets private. In the generated package, that will cause `compile` to be excluded from the dependency. Note that the default private assets when none is supplied is `contentfiles;build;analyzers`. Therefore, you should use `PrivateAssets="compile;contentfiles;build;analyzers"` in your `PackageReference` or `ProjectReference`.
1717

1818
```xml
1919
<ItemGroup>
20-
<ProjectReference Include="..\OtherProject\OtherProject.csproj" PrivateAssets="compile;build;analyzers" />
21-
<PackageReference Include="SomePackage" Version="1.2.3" PrivateAssets="compile;build;analyzers" />
20+
<ProjectReference Include="..\OtherProject\OtherProject.csproj" PrivateAssets="compile;contentfiles;build;analyzers" />
21+
<PackageReference Include="SomePackage" Version="1.2.3" PrivateAssets="compile;contentfiles;build;analyzers" />
2222
</ItemGroup>
2323
```
2424

0 commit comments

Comments
 (0)