10

In an MSBuild task, you can set the overall verbosity, but what I'd really like to do is set the Verbosity of just the 'Copy' command. It prints out a line for every file it's copying in the "normal" verbosity setting, which in my case is thousands of overly-detailed lines.

I don't see any documentation for such an attribute on the Copy task, so I'm wondering if there's another way... or if people just ditch the built in copy task and use robocopy with their own flags.

Tom Lianza
  • 4,012
  • 4
  • 41
  • 50

2 Answers2

1

You can write your own build logger. Add copy task to a specific target and filter build mesages from that specific target(s).

Here is nice example of custom logger.
You have to pass /logger parameter with your custom logger to MSBuild command line.

Ludwo
  • 6,043
  • 4
  • 32
  • 48
0

You can write your own Copy task, adding an optional Verbosity parameter.

Brian Kretzler
  • 9,748
  • 1
  • 31
  • 28
  • This is what I wound up doing, roughly. I actually grabbed the latest version of MSBuild Community Tasks ( http://msbuildtasks.tigris.org/ ) which has a robocopy task, which offers the ability to skip logging files and directories. It also has a number of other features (mirroring, retries, etc) which make it much nicer than the default Copy task. – Tom Lianza Apr 16 '12 at 07:55
  • Not a very good answer because it doesn't explain how to do such a thing nor link to an explanation. – stricq May 28 '19 at 17:43
  • Just for verbosity, it doesn't make any sense to write a custom task. Not sure why MS didn't add this support, when they actually have it for Robocopy – Ven May 14 '20 at 11:38