Skip to content

Commit 292e058

Browse files
committed
docs: impove FAQ
1 parent 29b6d3c commit 292e058

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ There **should no entry listed** that looks like:
163163
## Frequent questions
164164

165165
**Question**
166-
<br/>Why NuGet package does not include all dependencies when packing?
166+
<br/>Why doesn't my NuGet package include all dependencies when I run pack?
167167

168168
**Answer**
169169
<br/>Let's first assume the following:
@@ -176,16 +176,16 @@ There **should no entry listed** that looks like:
176176
177177
<!-- Project B -->
178178
<ItemGroup>
179-
<ProjectReference Include="ProjectA" PrivateAssets="all">
179+
<ProjectReference Include="ProjectA" PrivateAssets="all" />
180180
<!--<PackageReference Include="Tenekon.MSBuild.Packaging.ProjectBuildInPackage" Version="0.1.7" />-->
181181
</ItemGroup>
182182
```
183183

184-
You are telling NuGet that you don't want to have Project A to be picked up as NuGet-dependency. This is implicit, you don't have control about that. **The down-side is** the assmeblies of Project A, but not the assemblies of the packages of Project A, are not present in package of Project B.
184+
By setting `PrivateAssets="all"` on the `ProjectReference`, you tell NuGet not to emit Project A as a dependency when packing Project B.
185185

186-
By removing `PrivateAssets="all"` you disable the implicit behaviour of NuGet and the Project A will be picked up as NuGet dependency and EACH non-dependency package (also called transitive package).
186+
If you remove `PrivateAssets="all"`, NuGet can emit Project A as a package dependency, including its transitive package dependencies.
187187

188-
Now let's asumme this:
188+
Now let's assume this:
189189

190190
```
191191
<!-- Project A -->
@@ -195,14 +195,14 @@ Now let's asumme this:
195195
196196
<!-- Project B -->
197197
<ItemGroup>
198-
<ProjectReference Include="ProjectA" PrivateAssets="all">
198+
<ProjectReference Include="ProjectA" PrivateAssets="all" />
199199
<PackageReference Include="Tenekon.MSBuild.Packaging.ProjectBuildInPackage" Version="0.1.7" />
200200
</ItemGroup>
201201
```
202202

203-
By having installed my package I assist in the implicit behaviour of NuGet: By not picking up Project A as NuGet-dependency copy over the direct assemblies produced by Project A to the bin-folder of Project B. **This has the following drawback:**
203+
When this package is installed, it complements NuGet's behavior by copying Project A's build output into Project B's output. **This has the following drawback:**
204204

205-
Because of the implicit behaviour and the usage of my package you have assemblies of Project A in Project B that are in need of the assemblies provided by packages (in your example "Some Package") you referenced in Project A. So a workaround is to add the packages from Project A in Project B explicitly as shown here:
205+
As a result, Project B may contain Project A assemblies without the package-provided assemblies that Project A depends on (for example, `SomePackage`). So a workaround is to add the packages from Project A in Project B explicitly as shown here:
206206

207207
```
208208
<!-- Project A -->
@@ -212,7 +212,7 @@ Because of the implicit behaviour and the usage of my package you have assemblie
212212
213213
<!-- Project B -->
214214
<ItemGroup>
215-
<ProjectReference Include="ProjectA" PrivateAssets="all">
215+
<ProjectReference Include="ProjectA" PrivateAssets="all" />
216216
<PackageReference Include="Tenekon.MSBuild.Packaging.ProjectBuildInPackage" Version="0.1.7" />
217217
<!-- Use the SAME version like in Project A. -->
218218
<PackageReference Include="SomePackage" Version="*" />

0 commit comments

Comments
 (0)