Choosing a CopyToOutputDirectory Mode Overview The CopyToOutputDirectory metadata (and its publish counterpart CopyToPublishDirectory ) controls whether an item — Content , None , EmbeddedResource , or Compile — is copied next to your build output, and under what conditions the copy happens. Picking the wrong mode causes either stale files in bin/ or an unnecessary per-build performance hit. As of MSBuild 17.13 / .NET SDK 9.0.2xx there are four values: Mode Copies when… Incremental cost Typical use Never (default) Never None Files not needed at runtime PreserveNewest Source is newer than destination (or destination missing) Cheap (timestamp check) The common case — source files you edit Always Every build , unconditionally Expensive — copies on every build even in no-op builds Legacy workaround; avoid (see below) IfDifferent Source differs from destination in either direction (newer or older, or size differs, or destination missing) Cheap (timestamp + size check) Destination may be mutated between builds Show more Installs 1.1K Repository dotnet/skills GitHub Stars 5.4K First Seen Jul 17, 2026 Security Audits Gen Agent Trust Hub Pass Socket Pass Snyk Pass
copy-to-output-directory
安装
npx skills add https://github.com/dotnet/skills --skill copy-to-output-directory