Edit

Share via


MSB3024 diagnostic code

This article describes the MSB3024 error code.

Message text

MSB3024: Could not copy the file 'value' to the destination file 'value', because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles.

Description

This error occurs when, in the course of the build, an operation attempts to copy a file to another ___location, but the destination ___location already contains a folder of the same name. This is specifically generated by the MSBuild Copy task when it is passed a DestinationFiles parameter that contained a folder, rather than a set of files.

Resolution

You can get more information by running MSBuild with the -v:diag switch. The issue could occur if some previous part of the build created the folder, so you can check the log for what part of the build process does this.

If you control the target that calls the Copy task, and you intended to copy to a folder, you can accomplish that by using the DestinationFolder parameter instead.

Applies to

All versions of MSBuild