Daniel Powell
Daniel Powell

Reputation: 8303

msbuild copy files

I am having trouble copying files with MSbuild and the error messages I'm getting seem to contradict each other (using TFS 2008 to do the build).

I currently having the following in my build script

 <PropertyGroup>
      <ReleaseRoot>$(DropLocation)\Latest\x86\Release</ReleaseRoot>
      <WebRoot>$(ReleaseRoot)\_PublishedWebsites\Web</WebRoot>
      <DBRoot>$(ReleaseRoot)\Database</DBRoot>
      <TempHolingDir>$(ReleaseRoot)\temp)</TempHolingDir>
      <WebConfig>$(WebRoot)\Web.config</WebConfig>
      <DatabaseUpdate>$(DBRoot)\databaseupdate.exe</DatabaseUpdate>
    </PropertyGroup>

    <Copy SourceFiles="$(WebConfig);$(DatabaseUpdate)" DestinationFolder="$(TempHoldingDir)" ContinueOnError="false" />

When I run the build I get

error MSB3023: No destination specified for Copy. Please supply either "DestinationFiles" or "DestinationDirectory".

I then change the DestinationFolder to DestinationDirectory and I got

error MSB4064: The "DestinationDirectory" parameter is not supported by the "Copy" task. Verify the parameter exists on the task, and it is a settable public instance property. error MSB4063: The "Copy" task could not be initialized with its input parameters.

THese errors seem to contradict each other, what exactly am I missing here?

Upvotes: 7

Views: 15203

Answers (3)

cdsln
cdsln

Reputation: 898

Restarting Visual Studio resolved this for me, so adding this as a potential solution for anyone else experiencing the same issue.

Upvotes: 17

timB33
timB33

Reputation: 1987

It's DestinationFolder according to Copy Task, looks like MSB3023 error text is wrong?

Upvotes: 1

James Woolfenden
James Woolfenden

Reputation: 6681

Its because you called your property TempHolingDir when your referred to it as TempHoldingDir. Its all about the d.

Upvotes: 1

Related Questions