Skip to content
C

copy-to-output-directory

Choosing an MSBuild CopyToOutputDirectory / CopyToPublishDirectory mode: Never

by dotnetFree

#4293in AI Skills
0In stores

Description

Copy to Output Directory is an MSBuild agent skill from the dotnet/skills repository that helps the agent choose the right CopyToOutputDirec…

Highlights

  • Explains Never, PreserveNewest, Always and IfDifferent
  • Covers build output and publish directories
  • Notes the incremental build cost of each mode
  • IfDifferent guidance for MSBuild 17.13 and later

Ratings & Reviews

No ratings yet

Be the first to rate copy-to-output-directory.

People also visit

I

including-generated-files

Own MSBuild generated-artifact integration

AI Skills
Get
D

directory-build-organization

USE ONLY for (1) two or more projects

AI Skills
Get
C

check-bin-obj-clash

Detects MSBuild projects with conflicting OutputPath or IntermediateOutputPath

AI Skills
Get
P

property-patterns

Diagnose and fix concrete MSBuild property defects in projects

AI Skills
Get
B

build-perf-baseline

Establish MSBuild/.NET build performance baselines before optimizing

AI Skills
Get
I

incremental-build

Guide for optimizing MSBuild incremental builds

AI Skills
Get

copy-to-output-directory FAQ

Which mode should I use most of the time?

The skill describes PreserveNewest as the common case for source files you edit, because it only copies when the source is newer and costs a cheap timestamp check.

Why avoid Always?

It copies on every build, even builds where nothing changed, which slows builds. The skill calls it a legacy workaround.

When is IfDifferent useful?

When the destination file may be changed between builds. It copies if the source differs in either direction or by size. It needs MSBuild 17.13 / .NET SDK 9.0.2xx or later.

How do I add this skill to my agent?

Use the skills CLI: `npx skills add https://github.com/dotnet/skills --skill copy-to-output-directory`. This pulls the skill from dotnet/skills on GitHub.

Has the skill been security audited?

Yes. Results shown on skills.sh: Gen Agent Trust Hub: Pass, Socket: Pass, Snyk: Pass.

What are the best copy-to-output-directory alternatives?

Popular alternatives to copy-to-output-directory include including-generated-files, directory-build-organization and check-bin-obj-clash. See all copy-to-output-directory alternatives

Developer Stuff

Badges