Skip to content

Commit 9069d4a

Browse files
Copilotkzu
andcommitted
Document PackRefAssembly property in readme
Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
1 parent d93395a commit 9069d4a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

readme.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ When an item specifies *FrameworkSpecific=true*, the project's target framework
227227
|------------------|-------------------|
228228
| content (*) | true |
229229
| lib | true |
230+
| ref | true |
230231
| dependency (**) | true |
231232
| frameworkReference (**) | true |
232233
| build | false |
@@ -236,7 +237,7 @@ When an item specifies *FrameworkSpecific=true*, the project's target framework
236237

237238
\** *dependency* and *frameworkReference* are pseudo folders containing the package references and framework (`<Reference ...`) references.
238239

239-
\** tool(s), native, runtime(s), ref, analyzer(s), source/src, any custom folder.
240+
\*** tool(s), native, runtime(s), analyzer(s), source/src, any custom folder.
240241

241242
The `PackFolder` property (at the project level) determines the *PackFolder* metadata value for the build outputs of the project (and its xml docs, pdb and other related files like satellite assemblies). It defaults to `lib`.
242243

@@ -260,7 +261,8 @@ Whether items are packed by default or not is controlled by properties named aft
260261
| PackReadme | true |
261262
| PackSymbols | true if PackBuildOutput=true (*) |
262263
| PackSatelliteDlls | true if PackBuildOutput=true (**) |
263-
| PackDependencies| empty (***) |
264+
| PackRefAssembly | true if PackBuildOutput=true and ProduceReferenceAssembly=true (***) |
265+
| PackDependencies| empty (****) |
264266
| PackFrameworkReferences | true if PackFolder=lib, false if PackDependencies=false |
265267
| PackProjectReferences | true |
266268

@@ -272,7 +274,9 @@ Whether items are packed by default or not is controlled by properties named aft
272274
\** Satellite resources can come from the main project or from dependencies, if those PackageReferences
273275
have `PrivateAssets=all`.
274276

275-
\*** In some scenarios, you might want to turn off packing behavior for all PackageReference and FrameworkReferences alike. Setting PackDependencies=false achieves that.
277+
\*** When [ProduceReferenceAssembly](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/output#producereferenceassembly) is enabled, the reference assembly is automatically included in the `ref/[tfm]` folder alongside the implementation in `lib/[tfm]`.
278+
279+
\**** In some scenarios, you might want to turn off packing behavior for all PackageReference and FrameworkReferences alike. Setting PackDependencies=false achieves that.
276280

277281

278282
The various supported item inference are surfaced as `<PackInference Include="Compile;Content;None;..." />` items, which are ultimately evaluated together with the metadata for the individual items. These make the package inference candidates. You can also provide an exclude expression for that evaluation so that certain items are excluded by default, even if every other item of the same type is included. For example, to pack all `Content` items, except those in the `docs` folder, you can simply update the inference item like so:

0 commit comments

Comments
 (0)