msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Understanding CopyLocal, ReferenceOutputAssembly, & Private on

Open benvillalobos opened this issue 3 years ago • 0 comments

On ProjectReferences and PackageReferences.

We gotta start unifying this between MSBuild, the SDK, and NuGet.

Lingering Questions

  • What does CopyLocal default to?
  • What's the logic behind Private=true meaning "copy my stuff over"
  • Private (MSBuild) flows through items, does that change the behavior in RAR? Or only the "output" behavior?
  • Projects need to be able to tell things that reference it: Don't copy this item
    • What controls this?

CopyLocal & Private are equivalent but exist in different systems. CopyLocal (NuGet) <==> Private (MSBuild)

Private (MSBuild)

Private (MSBuild): Controls copying the output. Doesn't affect referencing.

  • Flows to references, flows to RAR.
  • Same as ExcludeAssets=runtime False: "Don't copy anything to the output directory" True (default): Let stuff copy

Private flows to new Reference items, and flows to ResolveAssemblyReferences. Same as ExcludeAssets=runtime

CopyLocal (NuGet)

"Do I take the thing and put it in the output folder?" True: Let stuff copy False: Don't copy anything to outdir.

ReferenceOutputAssembly (MSBuild)

True: Pass references to the compiler. Include that in output. Ultimately decides if the dll gets copied, even when Private=true False: Don't pass reference to compiler, don't include in output. Does this override Private=true?

[LEGACY] ReferenceOutputAssembly is equivalent to excludeassets=all. Its referenced, but nothing happens.

ExcludeAssets (NuGet)

"Do I reference compile, do I copy runtime? This needs a better quote, not sure I captured this. all: Don't reference and don't copy it out.

PrivateAssets (NuGet)

"What flows through me to my references?"

The goal here is probably to create ExcludeAssets/PrivateAssets equivalents in MSBuild.

benvillalobos avatar Sep 19 '22 22:09 benvillalobos