问题
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?
回答1:
It's DestinationFolder according to Copy Task, looks like MSB3023 error text is wrong?
回答2:
Its because you called your property TempHolingDir when your referred to it as TempHoldingDir. Its all about the d.
来源:https://stackoverflow.com/questions/6528459/msbuild-copy-files